mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-30 06:12:08 -06:00
handling error
This commit is contained in:
parent
8f765c90fc
commit
2a18964e8d
1 changed files with 5 additions and 1 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue