onError method
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);
}