runable
This commit is contained in:
30
lib/core/errors/exceptions.dart
Normal file
30
lib/core/errors/exceptions.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
/// Custom exceptions for the application
|
||||
class ServerException implements Exception {
|
||||
final String message;
|
||||
ServerException([this.message = 'Server error occurred']);
|
||||
}
|
||||
|
||||
class CacheException implements Exception {
|
||||
final String message;
|
||||
CacheException([this.message = 'Cache error occurred']);
|
||||
}
|
||||
|
||||
class NetworkException implements Exception {
|
||||
final String message;
|
||||
NetworkException([this.message = 'Network error occurred']);
|
||||
}
|
||||
|
||||
class ValidationException implements Exception {
|
||||
final String message;
|
||||
ValidationException([this.message = 'Validation error occurred']);
|
||||
}
|
||||
|
||||
class NotFoundException implements Exception {
|
||||
final String message;
|
||||
NotFoundException([this.message = 'Resource not found']);
|
||||
}
|
||||
|
||||
class UnauthorizedException implements Exception {
|
||||
final String message;
|
||||
UnauthorizedException([this.message = 'Unauthorized access']);
|
||||
}
|
||||
Reference in New Issue
Block a user