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

Support on error callback #101

Open
nhan-nguyen-se opened this issue Sep 2, 2021 · 0 comments
Open

Support on error callback #101

nhan-nguyen-se opened this issue Sep 2, 2021 · 0 comments

Comments

@nhan-nguyen-se
Copy link

When request fail I would like to do action like capture the error to Sentry. But if the cache is available then the request resolve immediately so the original error is lost.

To make it work, I can add two interceptors, one before and one after the cache interceptor:

  • If the cache is available then the error will be captured by the first one
  • If the cache is NOT available then the error will captured by the second one
    But this solution is not very effective because in case the cache is not available, the error will be captured twice.

It will be very useful if cache interceptor itself supports a callback when error happened.

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

No branches or pull requests

1 participant