40 lines
919 B
Dart
40 lines
919 B
Dart
class ServerException implements Exception {
|
|
const ServerException({
|
|
required this.message,
|
|
required this.statusCode,
|
|
});
|
|
|
|
final String message;
|
|
final int statusCode;
|
|
|
|
@override
|
|
String toString() => 'ServerException(message: $message, statusCode: $statusCode)';
|
|
}
|
|
|
|
class CacheException implements Exception {
|
|
const CacheException({required this.message});
|
|
|
|
final String message;
|
|
|
|
@override
|
|
String toString() => 'CacheException(message: $message)';
|
|
}
|
|
|
|
class NetworkException implements Exception {
|
|
const NetworkException({this.message = 'No internet connection'});
|
|
|
|
final String message;
|
|
|
|
@override
|
|
String toString() => 'NetworkException(message: $message)';
|
|
}
|
|
|
|
class UnauthorizedException implements Exception {
|
|
const UnauthorizedException({this.message = 'Unauthorized'});
|
|
|
|
final String message;
|
|
|
|
@override
|
|
String toString() => 'UnauthorizedException(message: $message)';
|
|
}
|