How can I catch errors while the map is running in a browser?
For example, I have this code:
require([
"esri/WebMap",
"esri/views/MapView"
], function(WebMap, MapView) {
webmap = new WebMap({
portalItem: {
id: "000000000000000000000000000000"
}
});
view = new MapView({
container: "viewDiv",
map: webmap
}
});
Everything works fine, but if I don't renew the token in time, or something happens to invalidate the token before it is time to be regenerated, I would get an error like this:
dojo-lite.js:261 [esri.views.2d.layers.features.controllers.OnDemandController]
How can I catch that with JavaScript? If I can catch it, I can generate a new token and handle it properly.
We are experiencing the same issue. If we keep map open and with no interaction for some hour, we get same errors and page (map) needs to be refreshed. Do we have a solution for this? Can we catch somewhere this error?
view.when(() => {}, (err) => { // handle err });
does not catch anything. Do we have an update on this?
Thank you