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) {
  // Log the cURL representation of the request when an error occurs.
  _logCurlRepresentation(err.requestOptions, isError: true);

  // Pass the error to the next handler in the chain.
  handler.next(err);
}