onError method

  1. @override
Future onError(
  1. DioError err,
  2. ErrorInterceptorHandler handler
)

Called when an exception was occurred during the request.

Implementation

@override
Future onError(
  DioError err,
  ErrorInterceptorHandler handler,
) async {
  await _stopMetric(err.response, err.requestOptions);
  return super.onError(err, handler);
}