I am having an issue where an XHR error is not properly caught. I am using the Offline.js library to do some checking.
The code the library is performing is:
Offline.checks.xhr = function() {
var e, xhr;
xhr = new XMLHttpRequest;
xhr.offline = false;
xhr.open(Offline.getOption('checks.xhr.type'), Offline.getOption('checks.xhr.url'), true);
if (xhr.timeout != null) {
xhr.timeout = Offline.getOption('checks.xhr.timeout');
}
checkXHR(xhr, Offline.markUp, Offline.markDown);
try {
xhr.send();
} catch (_error) {
e = _error;
Offline.markDown();
}
return xhr;
};
I suspect the catch not really catching everything. What then happens is that some other requests/promises are aborted. That causes other side effects in my application.
Has anyone ever had something similar? Is this done correctly?