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

Method handle_errors

python/ccxt/async_support/bitmex.py:3454–3468  ·  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

3452 return self.parse_order(response, market)
3453
3454 def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
3455 if response is None:
3456 return None
3457 if code == 429:
3458 raise DDoSProtection(self.id + ' ' + body)
3459 if code >= 400:
3460 error = self.safe_value(response, 'error', {})
3461 message = self.safe_string(error, 'message')
3462 feedback = self.id + ' ' + body
3463 self.throw_exactly_matched_exception(self.exceptions['exact'], message, feedback)
3464 self.throw_broadly_matched_exception(self.exceptions['broad'], message, feedback)
3465 if code == 400:
3466 raise BadRequest(feedback)
3467 raise ExchangeError(feedback) # unknown message
3468 return None
3469
3470 def nonce(self):
3471 return self.milliseconds()

Callers

nothing calls this directly

Calls 7

DDoSProtectionClass · 0.90
BadRequestClass · 0.90
ExchangeErrorClass · 0.90
safe_valueMethod · 0.80
safe_stringMethod · 0.80

Tested by

no test coverage detected