TF-1115 Add CacheExceptionThrower
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
abstract class CacheException with EquatableMixin implements Exception {
|
||||
|
||||
final String? message;
|
||||
|
||||
const CacheException({this.message});
|
||||
}
|
||||
|
||||
class UnknownCacheError extends CacheException {
|
||||
const UnknownCacheError({String? message}) : super(message: message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'package:tmail_ui_user/main/exceptions/cache_exception.dart';
|
||||
import 'package:tmail_ui_user/main/exceptions/exception_thrower.dart';
|
||||
|
||||
class CacheExceptionThrower extends ExceptionThrower {
|
||||
|
||||
@override
|
||||
void throwException(dynamic exception) {
|
||||
throw UnknownCacheError(message: exception.toString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user