Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic retries #99

Open
jjYBdx4IL opened this issue Jul 5, 2019 · 2 comments
Open

automatic retries #99

jjYBdx4IL opened this issue Jul 5, 2019 · 2 comments

Comments

@jjYBdx4IL
Copy link

jjYBdx4IL commented Jul 5, 2019

It would be desirable if api call template generation would include handling of "Bad Gateway" (-> retry) and "Not Found" (-> ApiException sub type) such that I don't have to write that boiler plate code for every api call I use myself. Maybe allow the user to install a hook into the api client to evaluate and respond to API responses on a general level.

Also, language and datasource parameters could be set once at the client level, instead of adding those parameters to each single call.

@GoldenGnu
Copy link
Collaborator

eve-esi is a low level library.
Retrying requests is beyond the scope of the library.

Specific class for specific error codes is not something we want to do, either. You should instead check the http code and response body of the ApiException, as each endpoint have its own error model.

I think the idea of having the datasource set on the client is good. Not sure about language, as, i don’t think it’s set on all requests? I will have to look into how much work that would require or if it’s already possible with stuff like extra headers.

@jjYBdx4IL
Copy link
Author

I had a quick look at ApiClient. Looks like it could be feasible to extend that class and overload a few methods to add the retry behaviour. Similarly, caching hooks could be added around the same parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants