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

Using super to extend Interceptor #4

Closed
cmendes0101 opened this issue Feb 24, 2022 · 1 comment
Closed

Using super to extend Interceptor #4

cmendes0101 opened this issue Feb 24, 2022 · 1 comment

Comments

@cmendes0101
Copy link

On the overrides, is there any reason this isn't just calling super for onRequest, onResponse, and onError?

Ex: return super.onRequest(options, handler);

When I use Dio I have multiple interceptors so in my client class I have:

Dio _dio = Dio(BaseOptions( baseUrl: URL, contentType: 'application/json; charset=utf-8')) ..interceptors.add(DioNetworkLogger()) ..interceptors.add(OtherInterceptor()));

When I use DioNetworkLogger it seems to hang my requests. I added the supers to continue the chain of requests and seems to work fine.

@cmendes0101
Copy link
Author

Sorry. I'm blind, it is calling super but some reason isn't passing through. I'll see what I was playing with to get it working on my side

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