Skip to content

Commit

Permalink
kucoin2 cancel order exception fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbr committed Feb 28, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 94e3689 commit 36501a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/kucoin2.js
Original file line number Diff line number Diff line change
@@ -144,7 +144,6 @@ module.exports = class kucoin2 extends Exchange {
'411100': AccountSuspended,
'500000': ExchangeError,
'order_not_exist': OrderNotFound, // {"code":"order_not_exist","msg":"order_not_exist"} ¯\_(ツ)_/¯
'order_not_exist_or_not_allow_to_cancel': InvalidOrder,
},
'fees': {
'trading': {
@@ -1081,8 +1080,11 @@ module.exports = class kucoin2 extends Exchange {
//
let errorCode = this.safeString (response, 'code');
if (errorCode in this.exceptions) {
const message = this.safeString (response, 'msg', '');
if (message === 'order_not_exist_or_not_allow_to_cancel') {
throw new InvalidOrder (this.id + ' ' + message);
}
let Exception = this.exceptions[errorCode];
let message = this.safeString (response, 'msg', '');
throw new Exception (this.id + ' ' + message);
}
}

0 comments on commit 36501a4

Please sign in to comment.