Skip to content

Commit

Permalink
refactor(dio): remove deprecated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RatakondalaArun committed Jul 30, 2023
1 parent c3c4453 commit 5c1311e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions lib/utils/tmdb_exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@ class TMDBException<T> implements Exception {
const TMDBException(this.message, {this.orginal, this.stackTrace});

@override
String toString() =>
'TMDBException(message: $message, orginal: $orginal, stackTrace: $stackTrace)';
String toString() => 'TMDBException(message: $message, orginal: $orginal, stackTrace: $stackTrace)';
}

class TMDBDioError extends TMDBException<DioError> {
class TMDBDioError extends TMDBException<DioException> {
final int? statusCode;

const TMDBDioError(
String message, {
required DioError orginal,
required DioException orginal,
this.statusCode,
}) : super(message, orginal: orginal);

@override
String toString() =>
'TMDBDioError(message: $message,orginal:$orginal, statusCode: $statusCode)';
String toString() => 'TMDBDioError(message: $message,orginal:$orginal, statusCode: $statusCode)';
}

class TMDBOtherException extends TMDBException<dynamic> {
Expand All @@ -34,6 +32,5 @@ class TMDBOtherException extends TMDBException<dynamic> {
StackTrace? stackTrace,
}) : super(message, orginal: orginal, stackTrace: stackTrace);
@override
String toString() =>
'TMDBDioError(message: $message,orginal:$orginal, stackTrace:$stackTrace)';
String toString() => 'TMDBDioError(message: $message,orginal:$orginal, stackTrace:$stackTrace)';
}
2 changes: 1 addition & 1 deletion lib/versions/v4.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class V4 extends Version {
);
}
return response.data!;
} on DioError catch (e) {
} on DioException catch (e) {
throw TMDBDioError(
e.message!,
orginal: e,
Expand Down

0 comments on commit 5c1311e

Please sign in to comment.