-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
The error handling function in request interceptors may not work as expect. #4537
Comments
use synchronousRequestInterceptors, onFuillfilled2 ---> onReject2 |
Thank you for your reply. It's my fault that I forgot to explain it'll only happen with asynchronous interceptors. But interceptors are presumed to be asynchronous by default and the behavior above is unreasonable, specially |
Hi there. |
Describe the issue
As the usage in README.md, a request interceptors will be like:
However, the
onRejected
function will handle the error in the next request intercetoronFulfilled
.Example Code
The output in console will be:
Expected behavior, if applicable
The better behavior may be that the error will be handled by function in the same request interceptor, I think.
Environment
Additional context/Screenshots
The following graph was drawn according to the source code. It may be helpful.
The text was updated successfully, but these errors were encountered: