@app-masters/js-lib
Advanced tools
Comparing version 1.2.13 to 1.2.14
@@ -129,3 +129,3 @@ "use strict"; | ||
}).catch(function (error) { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "POST", url, body); | ||
reject(error); | ||
@@ -152,3 +152,3 @@ }); | ||
}).catch(function (error) { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "PUT", url, body); | ||
reject(error); | ||
@@ -172,3 +172,3 @@ }); | ||
}).catch(function (error) { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "GET", url); | ||
reject(error); | ||
@@ -191,3 +191,3 @@ }); | ||
}).catch(function (error) { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "GET(download)", url); | ||
reject(error); | ||
@@ -212,3 +212,3 @@ }); | ||
}).catch(function (error) { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "DELETE", url); | ||
reject(error); | ||
@@ -215,0 +215,0 @@ }); |
@@ -39,3 +39,3 @@ "use strict"; | ||
key: "handle", | ||
value: function handle(error) { | ||
value: function handle(error, method, url, body) { | ||
var errorObj = { | ||
@@ -57,2 +57,5 @@ payload: error | ||
errorObj.method = method; | ||
errorObj.url = url; | ||
errorObj.body = body; | ||
var handler = errorLibrary[errorObj.name]; | ||
@@ -67,2 +70,3 @@ | ||
HttpErrorHandler.callback[handler.callback](errorObj); | ||
errorObj.sentToAnotherErrorHandler = true; | ||
} | ||
@@ -69,0 +73,0 @@ |
{ | ||
"name": "@app-masters/js-lib", | ||
"version": "1.2.13", | ||
"version": "1.2.14", | ||
"description": "JS lib", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -92,3 +92,3 @@ import HttpErrorHandler from './httpErrorHandler'; | ||
}).catch(error => { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "POST", url, body); | ||
reject(error); | ||
@@ -118,3 +118,3 @@ }); | ||
}).catch(error => { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "PUT", url, body); | ||
reject(error); | ||
@@ -141,3 +141,3 @@ }); | ||
}).catch(error => { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "GET", url); | ||
reject(error); | ||
@@ -162,3 +162,3 @@ }); | ||
}).catch(error => { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "GET(download)", url); | ||
reject(error); | ||
@@ -185,3 +185,3 @@ }); | ||
}).catch(error => { | ||
error = Http.errorHandler.handle(error); | ||
error = Http.errorHandler.handle(error, "DELETE", url); | ||
reject(error); | ||
@@ -188,0 +188,0 @@ }); |
@@ -15,3 +15,3 @@ import Rollbar from './rollbar'; | ||
static handle (error) { | ||
static handle (error, method, url, body) { | ||
const errorObj = {payload: error}; // Keep the original error on payload | ||
@@ -30,2 +30,6 @@ | ||
errorObj.method = method; | ||
errorObj.url = url; | ||
errorObj.body = body; | ||
const handler = errorLibrary[errorObj.name]; | ||
@@ -38,2 +42,3 @@ if (handler) { | ||
HttpErrorHandler.callback[handler.callback](errorObj); | ||
errorObj.sentToAnotherErrorHandler = true; | ||
} | ||
@@ -111,2 +116,2 @@ if (handler.level === null) { | ||
export default HttpErrorHandler; | ||
export default HttpErrorHandler; |
212533
5309