Comparing version 2.0.4 to 2.1.0
@@ -58,3 +58,3 @@ "use strict"; | ||
if(!(evt instanceof Error)){ | ||
evt = new Error("" + (evt || "unknown") ) | ||
evt = new Error("" + (evt || "Unknown XMLHttpRequest Error") ) | ||
} | ||
@@ -157,3 +157,5 @@ evt.statusCode = 0 | ||
xhr.abort("timeout") | ||
errorFunc(); | ||
var e = new Error("XMLHttpRequest timeout") | ||
e.code = "ETIMEDOUT" | ||
errorFunc(e) | ||
}, options.timeout ) | ||
@@ -160,0 +162,0 @@ } |
{ | ||
"name": "xhr", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"description": "small xhr abstraction", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -50,2 +50,4 @@ var window = require("global/window") | ||
assert.ok(err instanceof Error, "should return error") | ||
assert.equal(err.message, "XMLHttpRequest timeout") | ||
assert.equal(err.code, "ETIMEDOUT") | ||
assert.equal(resp.statusCode, 0) | ||
@@ -114,3 +116,3 @@ assert.end() | ||
assert.ok(err instanceof Error, "callback should get an error") | ||
assert.equal(err.message, "unknown", "error message should say 'unknown'") | ||
assert.equal(err.message, "Unknown XMLHttpRequest Error", "error message incorrect") | ||
}) | ||
@@ -117,0 +119,0 @@ assert.doesNotThrow(function () { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18414
294
7
1