Skip to content

Commit

Permalink
Move AccountFrozen to InvalidOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Risse committed May 30, 2018
1 parent 9bf6d1d commit 348472d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/base/errors.js
Expand Up @@ -20,12 +20,12 @@ module.exports = subclass (
'NullResponse': {},
},
'InsufficientFunds': {},
'AccountFrozen': {},
'InvalidAddress': {},
'InvalidOrder': {
'OrderNotFound': {},
'OrderNotCached': {},
'CancelPending': {},
'AccountFrozen': {},
},
'NotSupported': {},
},
Expand Down
6 changes: 3 additions & 3 deletions js/poloniex.js
Expand Up @@ -3,7 +3,7 @@
// ---------------------------------------------------------------------------

const Exchange = require ('./base/Exchange');
const { ExchangeError, ExchangeNotAvailable, RequestTimeout, AuthenticationError, DDoSProtection, InsufficientFunds, OrderNotFound, OrderNotCached, InvalidOrder, CancelPending, InvalidNonce, AccountFrozen } = require ('./base/errors');
const { ExchangeError, ExchangeNotAvailable, RequestTimeout, AuthenticationError, DDoSProtection, InsufficientFunds, OrderNotFound, OrderNotCached, InvalidOrder, AccountFrozen, CancelPending, InvalidNonce } = require ('./base/errors');

// ---------------------------------------------------------------------------

Expand Down Expand Up @@ -843,14 +843,14 @@ module.exports = class poloniex extends Exchange {
throw new DDoSProtection (feedback);
} else if (error.indexOf ('Total must be at least') >= 0) {
throw new InvalidOrder (feedback);
} else if (error.indexOf('This account is frozen.') >= 0) {
throw new AccountFrozen (feedback);
} else if (error.indexOf ('Not enough') >= 0) {
throw new InsufficientFunds (feedback);
} else if (error.indexOf ('Nonce must be greater') >= 0) {
throw new InvalidNonce (feedback);
} else if (error.indexOf ('You have already called cancelOrder or moveOrder on this order.') >= 0) {
throw new CancelPending (feedback);
} else if (error.indexOf('This account is frozen.') >= 0) {
throw new AccountFrozen (feedback);
} else {
throw new ExchangeError (this.id + ': unknown error: ' + this.json (response));
}
Expand Down

0 comments on commit 348472d

Please sign in to comment.