Comparing version 0.0.0-pre3 to 0.0.0-pre4
11
index.js
@@ -60,2 +60,3 @@ /* | ||
pro = pro | ||
.then(this.catchCorsError.bind(this)) | ||
.then(this.saveResponse.bind(this)) | ||
@@ -157,2 +158,12 @@ .then(this.parseBody.bind(this)); | ||
/* | ||
* (internal) catches cross origin request errors | ||
*/ | ||
Api.prototype.catchCorsError = function (res) { | ||
if (res && res.statusCode === 0) { | ||
throw new Error("API failed due to cross-origin error"); | ||
} | ||
}; | ||
/* | ||
* export | ||
@@ -159,0 +170,0 @@ */ |
{ | ||
"name": "ajaxapi", | ||
"version": "0.0.0-pre3", | ||
"version": "0.0.0-pre4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
19966
181