51 lines
1.4 KiB
Dart
51 lines
1.4 KiB
Dart
/// 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']);
|
|
}
|
|
|
|
class AuthenticationException implements Exception {
|
|
final String message;
|
|
AuthenticationException([this.message = 'Authentication failed']);
|
|
}
|
|
|
|
class InvalidCredentialsException implements Exception {
|
|
final String message;
|
|
InvalidCredentialsException([this.message = 'Invalid email or password']);
|
|
}
|
|
|
|
class TokenExpiredException implements Exception {
|
|
final String message;
|
|
TokenExpiredException([this.message = 'Token has expired']);
|
|
}
|
|
|
|
class ConflictException implements Exception {
|
|
final String message;
|
|
ConflictException([this.message = 'Resource already exists']);
|
|
}
|