We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 226c80e + a9f87ec commit 0af9c29Copy full SHA for 0af9c29
src/Affjax.js
@@ -53,9 +53,13 @@ exports._ajax = function () {
53
errback(e);
54
}
55
56
- xhr.onerror = function () {
57
- errback(new Error("AJAX request failed: " + options.method + " " + options.url));
+ var onerror = function (msg) {
+ return function () {
58
+ errback(new Error(msg + ": " + options.method + " " + options.url));
59
+ };
60
};
61
+ xhr.onerror = onerror("AJAX request failed");
62
+ xhr.ontimeout = onerror("AJAX request timed out");
63
xhr.onload = function () {
64
callback({
65
status: xhr.status,
0 commit comments