onError method

  1. @override
void onError(
  1. DioException err,
  2. ErrorInterceptorHandler handler
)

Called when an exception was occurred during the request.

Implementation

@override
void onError(DioException err, ErrorInterceptorHandler handler) {
  final response = err.response;
  if (response != null) {
    _complete(response);
  } else {
    final call = err.requestOptions.extra[_callKey];
    if (call is TracklyHttpCall) {
      _target.failCall(call, _describe(err));
    }
  }
  handler.next(err);
}