diff --git a/lib/features/cleanup/data/datasource_impl/cleanup_datasource_impl.dart b/lib/features/cleanup/data/datasource_impl/cleanup_datasource_impl.dart index f8bc1e1b0..19a6ebcfc 100644 --- a/lib/features/cleanup/data/datasource_impl/cleanup_datasource_impl.dart +++ b/lib/features/cleanup/data/datasource_impl/cleanup_datasource_impl.dart @@ -8,6 +8,7 @@ import 'package:tmail_ui_user/features/cleanup/domain/model/recent_login_url_cle import 'package:tmail_ui_user/features/cleanup/domain/model/recent_login_username_cleanup_rule.dart'; import 'package:tmail_ui_user/features/cleanup/domain/model/recent_search_cleanup_rule.dart'; import 'package:tmail_ui_user/features/thread/data/local/email_cache_manager.dart'; +import 'package:tmail_ui_user/main/exceptions/exception_thrower.dart'; class CleanupDataSourceImpl extends CleanupDataSource { @@ -15,12 +16,14 @@ class CleanupDataSourceImpl extends CleanupDataSource { final RecentSearchCacheManager recentSearchCacheManager; final RecentLoginUrlCacheManager recentLoginUrlCacheManager; final RecentLoginUsernameCacheManager recentLoginUsernameCacheManager; + final ExceptionThrower _exceptionThrower; CleanupDataSourceImpl( this.emailCacheManager, this.recentSearchCacheManager, this.recentLoginUrlCacheManager, - this.recentLoginUsernameCacheManager + this.recentLoginUsernameCacheManager, + this._exceptionThrower ); @override @@ -28,7 +31,7 @@ class CleanupDataSourceImpl extends CleanupDataSource { return Future.sync(() async { return await emailCacheManager.clean(cleanupRule); }).catchError((error) { - throw error; + _exceptionThrower.throwException(error); }); } @@ -37,7 +40,7 @@ class CleanupDataSourceImpl extends CleanupDataSource { return Future.sync(() async { return await recentSearchCacheManager.clean(cleanupRule); }).catchError((error) { - throw error; + _exceptionThrower.throwException(error); }); } @@ -46,7 +49,7 @@ class CleanupDataSourceImpl extends CleanupDataSource { return Future.sync(() async { return await recentLoginUrlCacheManager.clean(cleanupRule); }).catchError((error) { - throw error; + _exceptionThrower.throwException(error); }); } @@ -55,7 +58,7 @@ class CleanupDataSourceImpl extends CleanupDataSource { return Future.sync(() async { return await recentLoginUsernameCacheManager.clean(cleanupRule); }).catchError((error) { - throw error; + _exceptionThrower.throwException(error); }); } } \ No newline at end of file diff --git a/lib/features/home/presentation/home_bindings.dart b/lib/features/home/presentation/home_bindings.dart index d5f862805..4a3b8d41b 100644 --- a/lib/features/home/presentation/home_bindings.dart +++ b/lib/features/home/presentation/home_bindings.dart @@ -37,6 +37,7 @@ import 'package:tmail_ui_user/features/login/domain/usecases/get_credential_inte import 'package:tmail_ui_user/features/login/domain/usecases/get_stored_token_oidc_interactor.dart'; import 'package:tmail_ui_user/features/thread/data/local/email_cache_manager.dart'; import 'package:tmail_ui_user/main/bindings/network/binding_tag.dart'; +import 'package:tmail_ui_user/main/exceptions/cache_exception_thrower.dart'; import 'package:tmail_ui_user/main/utils/email_receive_manager.dart'; class HomeBindings extends BaseBindings { @@ -74,6 +75,7 @@ class HomeBindings extends BaseBindings { Get.find(), Get.find(), Get.find(), + Get.find(), )); Get.lazyPut(() => HiveAccountDatasourceImpl( Get.find()