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

Method handle_errors

python/ccxt/digifinex.py:4165–4176  ·  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

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