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.
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:
It will be very useful if cache interceptor itself supports a callback when error happened.