MCPcopy Create free account
hub / github.com/ccxt/ccxt / handle_errors

Method handle_errors

python/ccxt/ndax.py:2495–2510  ·  view source on GitHub ↗
(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody)

Source from the content-addressed store, hash-verified

2493 return {'url': url, 'method': method, 'body': body, 'headers': headers}
2494
2495 def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2496 if code == 404:
2497 raise AuthenticationError(self.id + ' ' + body)
2498 if response is None:
2499 return None
2500 #
2501 # {"status":"Rejected","errormsg":"Not_Enough_Funds","errorcode":101}
2502 # {"result":false,"errormsg":"Server Error","errorcode":102,"detail":null}
2503 #
2504 message = self.safe_string(response, 'errormsg')
2505 if (message is not None) and (message != ''):
2506 feedback = self.id + ' ' + body
2507 self.throw_exactly_matched_exception(self.exceptions['exact'], message, feedback)
2508 self.throw_broadly_matched_exception(self.exceptions['broad'], body, feedback)
2509 raise ExchangeError(feedback)
2510 return None

Callers

nothing calls this directly

Calls 5

AuthenticationErrorClass · 0.90
ExchangeErrorClass · 0.90
safe_stringMethod · 0.80

Tested by

no test coverage detected