Skip to content

Commit

Permalink
feat(upgrade): use DioException instead of DioError
Browse files Browse the repository at this point in the history
Signed-off-by: Taranjeet Singh <[email protected]>
  • Loading branch information
singhtaranjeet committed Aug 25, 2023
1 parent ee2068a commit e0dcaee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/src/exceptions/errors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/interceptors/error_interceptor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e0dcaee

Please sign in to comment.