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

Method handle_errors

python/ccxt/coinbaseexchange.py:2037–2046  ·  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

2035 return {'url': url, 'method': method, 'body': body, 'headers': headers}
2036
2037 def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2038 if (code == 400) or (code == 404):
2039 if body[0] == '{':
2040 message = self.safe_string(response, 'message')
2041 feedback = self.id + ' ' + message
2042 self.throw_exactly_matched_exception(self.exceptions['exact'], message, feedback)
2043 self.throw_broadly_matched_exception(self.exceptions['broad'], message, feedback)
2044 raise ExchangeError(feedback) # unknown message
2045 raise ExchangeError(self.id + ' ' + body)
2046 return None
2047
2048 def request(self, path, api='public', method='GET', params={}, headers=None, body=None, config={}):
2049 response = self.fetch2(path, api, method, params, headers, body, config)

Callers

nothing calls this directly

Calls 4

ExchangeErrorClass · 0.90
safe_stringMethod · 0.80

Tested by

no test coverage detected