Comparing version 0.2.2 to 0.2.3
@@ -25,3 +25,3 @@ import { param } from '../param/index.js' | ||
data: null, | ||
headers: null, | ||
headers: {}, | ||
timeout: 30 * 1000, | ||
@@ -91,7 +91,13 @@ async: true, | ||
xhr.onerror = err => { | ||
let message = '' | ||
if (err) { | ||
onerror(new Error(err.message || err.name || err.type || 'Request Error')) | ||
} else { | ||
onerror(new Error('Request Error')) | ||
message = err.message || err.name || err.type | ||
} | ||
if (!message || message === 'error') { | ||
message = xhr.responseText || 'Request Error' | ||
} | ||
onerror(new Error(message)) | ||
} | ||
@@ -98,0 +104,0 @@ } |
{ | ||
"name": "dx-lib", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "dx fe lib", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
198043
1961