You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While requesting large amounts of data (1 month or more at 1min candles) using the get_kline() and passing parameters pageSize and currentPage, the server returns the error 429-{"code":"429000","msg":"Too Many Requests"} even when putting 15 - 30 sec wait times in between single execution of the method.
The KucoinBaseRestAPI object from the python-sdk has a static method check_response_data that is set to raise a ValueError if the response is not 200 OK. This is what was causing my app to error out even though this error is a server error. To bypass this I have to put it in a try catch block with a pass action when the error is caught. This works but is not ideal for a variety of reasons.
Might I request that the ability to override this functionality manually or specify a custom error handling method of some sort. Causing anything outside of a 200 response to raise an error seems slightly problematic. Here is the block I am requesting to have reviewed:
def check_response_data(response_data): if response_data.status_code == 200: try: data = response_data.json() except ValueError: raise Exception(response_data.content) else: if data and data.get('code'): if data.get('code') == '200000': if data.get('data'): return data['data'] else: return data else: raise Exception("{}-{}".format(response_data.status_code, response_data.text)) else: raise Exception("{}-{}".format(response_data.status_code, response_data.text))
The text was updated successfully, but these errors were encountered:
While requesting large amounts of data (1 month or more at 1min candles) using the get_kline() and passing parameters pageSize and currentPage, the server returns the error 429-{"code":"429000","msg":"Too Many Requests"} even when putting 15 - 30 sec wait times in between single execution of the method.
The KucoinBaseRestAPI object from the python-sdk has a static method check_response_data that is set to raise a ValueError if the response is not 200 OK. This is what was causing my app to error out even though this error is a server error. To bypass this I have to put it in a try catch block with a pass action when the error is caught. This works but is not ideal for a variety of reasons.
Might I request that the ability to override this functionality manually or specify a custom error handling method of some sort. Causing anything outside of a 200 response to raise an error seems slightly problematic. Here is the block I am requesting to have reviewed:
def check_response_data(response_data): if response_data.status_code == 200: try: data = response_data.json() except ValueError: raise Exception(response_data.content) else: if data and data.get('code'): if data.get('code') == '200000': if data.get('data'): return data['data'] else: return data else: raise Exception("{}-{}".format(response_data.status_code, response_data.text)) else: raise Exception("{}-{}".format(response_data.status_code, response_data.text))
The text was updated successfully, but these errors were encountered: