TF-1115 Implement catch exception for EmailDataSource

This commit is contained in:
dab246
2022-10-28 12:05:53 +07:00
committed by Dat H. Pham
parent da90a2b2fc
commit d4187eec74
9 changed files with 39 additions and 25 deletions
@@ -1,10 +1,9 @@
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 error) {
throw UnknownCacheError(message: error.toString());
throw error;
}
}
@@ -32,7 +32,7 @@ class RemoteExceptionThrower extends ExceptionThrower {
message: errorResponse.description);
}
} else {
throw UnknownError(message: error.toString());
throw error;
}
}
}