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

Method handle_errors

python/ccxt/xt.py:4796–4860  ·  view source on GitHub ↗
(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody)

Source from the content-addressed store, hash-verified

4794 return self.parse_order(result, market)
4795
4796 def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
4797 #
4798 # spot: error
4799 #
4800 # {
4801 # "rc": 1,
4802 # "mc": "AUTH_103",
4803 # "ma": [],
4804 # "result": null
4805 # }
4806 #
4807 # spot: success
4808 #
4809 # {
4810 # "returnCode": 0,
4811 # "msgInfo": "success",
4812 # "error": null,
4813 # "result": []
4814 # }
4815 #
4816 # swap and future: error
4817 #
4818 # {
4819 # "returnCode": 1,
4820 # "msgInfo": "failure",
4821 # "error": {
4822 # "code": "403",
4823 # "msg": "invalid signature"
4824 # },
4825 # "result": null
4826 # }
4827 #
4828 # swap and future: success
4829 #
4830 # {
4831 # "returnCode": 0,
4832 # "msgInfo": "success",
4833 # "error": null,
4834 # "result": null
4835 # }
4836 #
4837 # other:
4838 #
4839 # {
4840 # "rc": 0,
4841 # "mc": "SUCCESS",
4842 # "ma": [],
4843 # "result": {}
4844 # }
4845 #
4846 # {"returnCode":1,"msgInfo":"failure","error":{"code":"insufficient_balance","msg":"insufficient balance","args":[]},"result":null}
4847 #
4848 #
4849 status = self.safe_string_upper_2(response, 'msgInfo', 'mc')
4850 if status is not None and status != 'SUCCESS':
4851 feedback = self.id + ' ' + body
4852 error = self.safe_value(response, 'error', {})
4853 spotErrorCode = self.safe_string(response, 'mc')

Callers

nothing calls this directly

Calls 6

ExchangeErrorClass · 0.90
safe_string_upper_2Method · 0.80
safe_valueMethod · 0.80
safe_stringMethod · 0.80

Tested by

no test coverage detected