Return error from Shapeshift when pairs are unavailable.
This commit is contained in:
parent
a8e5c212f0
commit
1b0541a7b5
1 changed files with 7 additions and 0 deletions
|
|
@ -23,6 +23,13 @@ var ShapeShift = (function() {
|
|||
if (xmlhttp.status == 200) {
|
||||
var parsedResponse = JP(xmlhttp.responseText);
|
||||
cb.apply(null, [parsedResponse]);
|
||||
} else if (xmlhttp.status === 500) {
|
||||
var parsedResponse = JP(xmlhttp.responseText);
|
||||
if (typeof parsedResponse.error === 'string') {
|
||||
cb.apply(null, [parsedResponse]);
|
||||
} else {
|
||||
cb.apply(null, [new Error('Request Failed')]);
|
||||
}
|
||||
} else {
|
||||
cb.apply(null, [new Error('Request Failed')])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue