onError method

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

Called when an exception was occurred during the request.

Implementation

@override
void onError(DioError err, ErrorInterceptorHandler handler) {
  super.onError(err, handler);
  try {
    final message = '${err.requestOptions.uri}';
    final httpErrorLog = HttpErrorLog(
      message,
      dioError: err,
      settings: settings,
    );
    _talker.logTyped(httpErrorLog);
  } catch (_) {
    //pass
  }
}