diff --git a/lib/utils/tmdb_exceptions.dart b/lib/utils/tmdb_exceptions.dart index 1047f7c..c7160a8 100644 --- a/lib/utils/tmdb_exceptions.dart +++ b/lib/utils/tmdb_exceptions.dart @@ -9,22 +9,20 @@ class TMDBException 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 { +class TMDBDioError extends TMDBException { 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 { @@ -34,6 +32,5 @@ class TMDBOtherException extends TMDBException { 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)'; } diff --git a/lib/versions/v4.dart b/lib/versions/v4.dart index ea57670..6c78156 100644 --- a/lib/versions/v4.dart +++ b/lib/versions/v4.dart @@ -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,