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

Method handle_errors

python/ccxt/bit2c.py:970–986  ·  view source on GitHub ↗
(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody)

Source from the content-addressed store, hash-verified

968 return {'url': url, 'method': method, 'body': body, 'headers': headers}
969
970 def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
971 if response is None:
972 return None # fallback to default error handler
973 #
974 # {"error" : "please approve new terms of use on site."}
975 # {"error": "Please provide valid nonce in Request Nonce(1598218490) is not bigger than last nonce(1598218490)."}
976 # {"Error" : "No order found."}
977 #
978 error = self.safe_string(response, 'error')
979 if error is None:
980 error = self.safe_string(response, 'Error')
981 if error is not None:
982 feedback = self.id + ' ' + body
983 self.throw_exactly_matched_exception(self.exceptions['exact'], error, feedback)
984 self.throw_broadly_matched_exception(self.exceptions['broad'], error, feedback)
985 raise ExchangeError(feedback) # unknown message
986 return None

Callers

nothing calls this directly

Calls 4

ExchangeErrorClass · 0.90
safe_stringMethod · 0.80

Tested by

no test coverage detected