Files
flutter-frame/lib/core/error/exceptions.dart
2026-03-01 07:55:59 +09:00

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)';
}