Within my application, there is a grid that retrieves data through HTTP promises. Currently, I am able to recognize errorCallback
s - as demonstrated below:
myDataPromise.then(function () {
//do stuff
}, function errorCallback(response) {
if (response.statusText === "Not Found") {
//do stuff
}else if(response.statusText === "Internal Server Error"){
//do stuff
}
However, in the case of an SSL error, such as "ERR::CONNECTION REFUSED" returned by Chrome, I am unable to detect it as easily as I can with 404 errors, for example. What I really want is to show a simple message or image indicating that there was an error in retrieving the user's data, regardless of the specific error. If an HTTP GET request fails in any way, the user should be informed. This requirement seems common, yet I am having trouble finding relevant information online.