onError method
Called when an exception was occurred during the request.
Implementation
@override
void onError(DioException err, ErrorInterceptorHandler handler) {
final options = err.requestOptions;
final requestPath = '${options.baseUrl}${options.path}';
// Log the error request and error message
if (responseError) {
logDebug('onError: ${options.method} request => $requestPath', level: Level.error);
logDebug('onError: ${err.error}, Message: ${err.message}', level: Level.debug);
}
// Call the super class to continue handling the error
return super.onError(err, handler);
}