Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Server Side Error - 429-{"code":"429000","msg":"Too Many Requests"} #83

Open
rroline opened this issue Sep 19, 2022 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@rroline
Copy link

rroline commented Sep 19, 2022

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))

@ISAAC-XXYYZZ ISAAC-XXYYZZ self-assigned this Jul 29, 2024
@ISAAC-XXYYZZ ISAAC-XXYYZZ added the enhancement New feature or request label Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants