hurshi / dio-http-cache

http cache lib for Flutter dio like RxCache
Apache License 2.0
274 stars 223 forks source link

Support on error callback #101

Open nhan-nguyen-se opened 3 years ago

nhan-nguyen-se commented 3 years ago

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.