From e0dcaee457d0c63fa4183c297dae7d0b24ecc2a6 Mon Sep 17 00:00:00 2001 From: Taranjeet Singh Date: Fri, 25 Aug 2023 16:01:11 +0530 Subject: [PATCH] feat(upgrade): use DioException instead of DioError Signed-off-by: Taranjeet Singh --- lib/src/exceptions/errors.dart | 8 ++++---- lib/src/interceptors/error_interceptor.dart | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/exceptions/errors.dart b/lib/src/exceptions/errors.dart index 69eff8c..c2acda7 100644 --- a/lib/src/exceptions/errors.dart +++ b/lib/src/exceptions/errors.dart @@ -114,7 +114,7 @@ class UnauthenticatedError extends DioException { : 'Unauthenticated, Please try again'; } - UnauthenticatedError.fromDioError(DioError error) + UnauthenticatedError.fromDioError(DioException error) : super( requestOptions: error.requestOptions, response: error.response, @@ -187,11 +187,11 @@ class UnstableInternetError extends DioException { } } -class RequestCancelError extends DioError { +class RequestCancelError extends DioException { RequestCancelError({ required requestOptions, response, - type = DioErrorType.other, + type = DioExceptionType.unknown, error, this.showStackTrace = false, }) : super( @@ -201,7 +201,7 @@ class RequestCancelError extends DioError { error: error, ); - RequestCancelError.fromDioError(DioError error, bool showStackTrace) + RequestCancelError.fromDioError(DioException error, bool showStackTrace) : showStackTrace = showStackTrace, super( type: error.type, diff --git a/lib/src/interceptors/error_interceptor.dart b/lib/src/interceptors/error_interceptor.dart index acc6ab6..3f484fd 100644 --- a/lib/src/interceptors/error_interceptor.dart +++ b/lib/src/interceptors/error_interceptor.dart @@ -110,7 +110,7 @@ abstract class ErrorInterceptor extends Interceptor { ); } - if (error.type == DioErrorType.cancel) { + if (error.type == DioExceptionType.cancel) { return handler.reject( RequestCancelError.fromDioError( error,