handling error

This commit is contained in:
narayana shanubhogh 2021-04-26 08:40:46 +05:30
parent 8f765c90fc
commit 2a18964e8d

View file

@ -217,7 +217,11 @@ export function Axios(config) {
if (!_.inRange(error.response.status, 200, 300)) {
let body = error.response.data;
if (typeof body === 'object') {
reject(new exceptionClass(body));
var result = {};
result['message'] = body.error
result['stack'] = error.stack
result['name'] = error.name
reject(new exceptionClass(result));
}
}
reject(error.stack + '\n' + JSON.stringify(error.response.data));