-
Notifications
You must be signed in to change notification settings - Fork 62
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
Question: How do I use this with existing error interceptors? #94
Comments
PS: If it's not clear, the second call to my generic handler does not receive the configuration object for axios so I can't get the details for my logs. The first does. I only want to log the second. |
@JustinBeckwith is this something you can answer or do you think this is more of a Stack Overflow Question? I'm kind of wondering if there's a feature request in here for like "callback for final error" such that you get it after failed number of retries or the failure case for requests that don't get retries. |
@JustinBeckwith any suggestion here? 🙏 |
Greetings! Not something I've had time to look into, apologies. |
@JustinBeckwith I realize attach is just doing If you exported What do you think of that strategy? |
@DaveStein - did you ever find a solution for this? |
@danthareja we made our own interceptor that would instantiate a new instance of axios and go from there. |
This library looks like exactly what I need. I am trying it out with code like this:
interceptors.response.error
is where I build up custom error for logging, which includes the request & response details. At the top I threw this in:When I purposefully error via gibberish URL the console.logs output this:
How should I ensure that my logic only runs after final attempt AND for any error that has no retries? ie an error with POST, which would never really run
onRetryAttempt
Right now it looks to fire your plugin twice followed by my generic handler twice.
The text was updated successfully, but these errors were encountered: