초기 커밋
This commit is contained in:
39
lib/core/error/exceptions.dart
Normal file
39
lib/core/error/exceptions.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
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)';
|
||||
}
|
||||
Reference in New Issue
Block a user