AnsweredAssumed Answered

How to handle layer errors

Question asked by kevinhaeni on Mar 28, 2018
Latest reply on Mar 28, 2018 by kenbuja

Hello,

In JSAPI 3.x, it was possible to react to layer errors, like for example if the map service is not available, with the following code:

 

this.layer.on('error', function(evt) {
    if (evt.error.code === 400) {
      this.notificationService.error('Layer Error', `Message: ${evt.error.
message}`);
    }
}

With layer being a FeatureLayer object.

I don't really see how this can be achieved using JSAPI 4.x. Any ideas?

Outcomes