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

Method handle_errors

python/ccxt/async_support/digifinex.py:4166–4177  ·  view source on GitHub ↗
(self, statusCode: int, statusText: str, url: str, method: str, responseHeaders: dict, responseBody, response, requestHeaders, requestBody)

Source from the content-addressed store, hash-verified

4164 return {'url': url, 'method': method, 'body': body, 'headers': headers}
4165
4166 def handle_errors(self, statusCode: int, statusText: str, url: str, method: str, responseHeaders: dict, responseBody, response, requestHeaders, requestBody):
4167 if not response:
4168 return None # fall back to default error handler
4169 code = self.safe_string(response, 'code')
4170 if (code == '0') or (code == '200'):
4171 return None # no error
4172 feedback = self.id + ' ' + responseBody
4173 if code is None:
4174 raise BadResponse(feedback)
4175 unknownError = [ExchangeError, feedback]
4176 ExceptionClass, message = self.safe_value(self.exceptions['exact'], code, unknownError)
4177 raise ExceptionClass(message)

Callers

nothing calls this directly

Calls 3

BadResponseClass · 0.90
safe_stringMethod · 0.80
safe_valueMethod · 0.80

Tested by

no test coverage detected