Skip to content
Permalink
Browse files
bithumb handling for AuthenticationError #4255
  • Loading branch information
kroitor committed Nov 30, 2018
1 parent 6bcc9df commit a048635ebaf9836f06ac9c8e9155e81ed885ee99
Showing with 7 additions and 3 deletions.
  1. +7 −3 js/bithumb.js
@@ -3,7 +3,7 @@
// ---------------------------------------------------------------------------

const Exchange = require ('./base/Exchange');
const { ExchangeError } = require ('./base/errors');
const { ExchangeError, AuthenticationError } = require ('./base/errors');

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

@@ -65,7 +65,8 @@ module.exports = class bithumb extends Exchange {
},
},
'exceptions': {
'5100': ExchangeError, // {"status":"5100","message":"After May 23th, recent_transactions is no longer, hence users will not be able to connect to recent_transactions"}
'Bad Request.(Auth Data)': AuthenticationError, // { "status": "5100", "message": "Bad Request.(Auth Data)" }
'After May 23th, recent_transactions is no longer, hence users will not be able to connect to recent_transactions': ExchangeError, // {"status":"5100","message":"After May 23th, recent_transactions is no longer, hence users will not be able to connect to recent_transactions"}
},
});
}
@@ -366,14 +367,17 @@ module.exports = class bithumb extends Exchange {
//
// {"status":"5100","message":"After May 23th, recent_transactions is no longer, hence users will not be able to connect to recent_transactions"}
//
let status = this.safeString (response, 'status');
const status = this.safeString (response, 'status');
const message = this.safeString (response, 'message');
if (status !== undefined) {
if (status === '0000')
return; // no error
const feedback = this.id + ' ' + this.json (response);
const exceptions = this.exceptions;
if (status in exceptions) {
throw new exceptions[status] (feedback);
} else if (message in exceptions) {
throw new exceptions[message] (feedback);
} else {
throw new ExchangeError (feedback);
}

0 comments on commit a048635

Please sign in to comment.