More specific Shapeshift error handling.
This commit is contained in:
parent
71e530f535
commit
c79ca6d1af
1 changed files with 4 additions and 4 deletions
|
|
@ -29,12 +29,12 @@ angular
|
||||||
return service;
|
return service;
|
||||||
|
|
||||||
function handleError(response, defaultMessage, cb) {
|
function handleError(response, defaultMessage, cb) {
|
||||||
if (!response) {
|
if (response && typeof response.error === "string") {
|
||||||
cb(new Error(defaultMessage));
|
|
||||||
} else if (response.error && !response.error.message) {
|
|
||||||
cb(new Error(response.error));
|
cb(new Error(response.error));
|
||||||
} else {
|
} else if (response && response.error && response.error.message) {
|
||||||
cb(new Error(response.error.message));
|
cb(new Error(response.error.message));
|
||||||
|
} else {
|
||||||
|
cb(new Error(defaultMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue