I have implemented ESRI 4.27v in my Angular Project. My requirement is to pass all the Map API calls via interceptor and catch for 500 error which comes on server down and implement a retry mechanism.
So i have added interceptors and now all APIs goes via this and error is captured when Server down. But it gives only
error.message = 'Failed to fetch'
error.name = 'request:server'
No error code.
esriConfig.request.interceptors.push({
urls: MapUrl,
before: function (response) {
console.log("interceptor before ", response);
},
after: function (response) {
console.log("interceptor after ", response);
},
error: function (error) {
console.log("interceptor errror ", error);
}
});
The error does not contain any error code. Hence not able to identify if its actually 500 error. How can i get the error code?