You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the DioInterceptor, should a request throw a DioError, other interceptors are not informed.
dio_interceptor.dart contains the method void onRequest(options, handler) async, and the following is the issue:
if (isError(response)) {
handler.reject(response as DioError);
return;
}
reject should be passing callFollowingErrorInterceptor = true
void reject(DioError error, [bool callFollowingErrorInterceptor = false])
package:dio/src/interceptor.dart
Complete the request with an error! Other request/response interceptor(s) will not be executed, but error interceptor(s) may be executed, which depends on whether the value of parameter [callFollowingErrorInterceptor] is true.
[error]: Error info to reject. [callFollowingErrorInterceptor]: Whether to call the error interceptor(s).
Description
Using the DioInterceptor, should a request throw a DioError, other interceptors are not informed.
dio_interceptor.dart
contains the methodvoid onRequest(options, handler) async
, and the following is the issue:reject
should be passingcallFollowingErrorInterceptor = true
Stacktrace:
Steps to reproduce
Testing code:
Code being tested:
Expected behavior
I expect any error interceptor to be called if there's an error thrown in the onGet request
System details
http_mock_adapter: ^0.2.1
dio: ^4.0.0
The text was updated successfully, but these errors were encountered: