mirror of
https://github.com/Livinglist/Hacki.git
synced 2025-08-06 18:24:42 +08:00
25 lines
634 B
Dart
25 lines
634 B
Dart
typedef AppExceptionHandler = void Function(AppException);
|
|
|
|
class AppException implements Exception {
|
|
AppException({
|
|
required this.message,
|
|
this.stackTrace,
|
|
});
|
|
|
|
final String message;
|
|
final StackTrace? stackTrace;
|
|
}
|
|
|
|
class RateLimitedException extends AppException {
|
|
RateLimitedException() : super(message: 'Rate limited...');
|
|
}
|
|
|
|
class RateLimitedWithFallbackException extends AppException {
|
|
RateLimitedWithFallbackException()
|
|
: super(message: 'Rate limited, fetching from API instead...');
|
|
}
|
|
|
|
class GeneralException extends AppException {
|
|
GeneralException() : super(message: 'Something went wrong...');
|
|
}
|