softonic / axios-retry

Axios plugin that intercepts failed requests and retries them whenever possible
Other
1.9k stars 167 forks source link

`onRetry(...)` Hook #160

Closed jmrapp1 closed 2 years ago

jmrapp1 commented 3 years ago

Added an onRetry(retryCount: number, error: axios.AxiosError, requestConfig: axios.AxiosRequestConfig) => void configuration function that acts as a notifier when a retry is happening. I have this use-case in my own app that requires tracing when a retry happens. The function provides the retry amount, the error that triggered the retry, and the requestConfig from the failed request.

eduardogalbiati commented 3 years ago

I would like to see this feature merged too!, It's really good for logging, is there any problem here with this PR? why is not approved yet? can I help?

Thanks

jmrapp1 commented 3 years ago

I would like to see this feature merged too!, It's really good for logging, is there any problem here with this PR? why is not approved yet? can I help?

Thanks

Not sure. Unfortunately it seems like this package may be dead because the maintainers haven't come back to it in over a year. Only option you may have for the time being is to fork off my branch and manually import it locally to your project :/

mindhells commented 2 years ago

I believe this is covered in #202