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

Feature Request: Ability to add message/handler when retry is triggered. #134

Closed
fmaiabatista opened this issue May 3, 2020 · 4 comments
Labels

Comments

@fmaiabatista
Copy link

Hi, I took a look at the API but it doesn't seem to include any way for us to configure a message when the retry happens.

I was wondering if it'd be possible to add a way that we can set a message/handler whenever the retry is triggered.

Something like:

const handler = () => console.log("Retrying...");

axiosRetry(axios, {
  retries: 5,
  retryDelay: axiosRetry.exponentialDelay,
  onRetry: handler
});
@fmaiabatista fmaiabatista changed the title Feature Request: Ability to receive feedback message on retry Feature Request: Ability to add message/handler when retry is triggered. May 3, 2020
@mawrkus
Copy link
Contributor

mawrkus commented May 3, 2020

HI!
If it's only for logging a message, I guess you can use a customised retryDelay (as a function) or retryCondition.

@fmaiabatista
Copy link
Author

Alright! I'll try that! Thanks!

@mriedem
Copy link

mriedem commented Sep 28, 2022

Was this fixed with #202?

@mindhells
Copy link
Member

#202

I think so (well not a fix, actually a new feature)
well spotted, thank you sir!

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

No branches or pull requests

4 participants