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

Retry network errors #281

Open
guss84 opened this issue Sep 24, 2024 · 0 comments · May be fixed by #287
Open

Retry network errors #281

guss84 opened this issue Sep 24, 2024 · 0 comments · May be fixed by #287

Comments

@guss84
Copy link
Collaborator

guss84 commented Sep 24, 2024

In some cases the /statistics endpoint throws a 502 Bad Gateway or CORS error. This happens when many requests are made one after another. We should retry these requests, but it is currently ignored by shouldRetry because there is no response in the AxiosError in this case. Axios does add code: ERR_NETWORK to the error object, so we should also retry requests when there is no response but the error code is ERR_NETWORK.

Axios error codes can be seen at https://github.com/axios/axios/blob/1472163d373dda71f74e86365ee2f298d922f5db/lib/core/AxiosError.js#L61
axios-retry has the following logic for network errors https://github.com/softonic/axios-retry/blob/v4.5.0/src/index.ts#L95

Logging error in shoudlRetry:
image

@guss84 guss84 linked a pull request Nov 22, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant