TF-1115 Implement catch exception for MailboxDataSource

This commit is contained in:
dab246
2022-10-28 11:59:47 +07:00
committed by Dat H. Pham
parent 5746d031b9
commit da90a2b2fc
13 changed files with 92 additions and 37 deletions
@@ -43,6 +43,7 @@ import 'package:tmail_ui_user/features/thread/domain/usecases/refresh_changes_em
import 'package:tmail_ui_user/features/thread/domain/usecases/search_email_interactor.dart';
import 'package:tmail_ui_user/features/thread/domain/usecases/search_more_email_interactor.dart';
import 'package:tmail_ui_user/features/thread/presentation/thread_controller.dart';
import 'package:tmail_ui_user/main/exceptions/cache_exception_thrower.dart';
import 'package:tmail_ui_user/main/exceptions/remote_exception_thrower.dart';
class ThreadBindings extends BaseBindings {
@@ -78,8 +79,13 @@ class ThreadBindings extends BaseBindings {
@override
void bindingsDataSourceImpl() {
Get.lazyPut(() => MailboxDataSourceImpl(Get.find<MailboxAPI>(), Get.find<MailboxIsolateWorker>()));
Get.lazyPut(() => MailboxCacheDataSourceImpl(Get.find<MailboxCacheManager>()));
Get.lazyPut(() => MailboxDataSourceImpl(
Get.find<MailboxAPI>(),
Get.find<MailboxIsolateWorker>(),
Get.find<RemoteExceptionThrower>()));
Get.lazyPut(() => MailboxCacheDataSourceImpl(
Get.find<MailboxCacheManager>(),
Get.find<CacheExceptionThrower>()));
Get.lazyPut(() => ThreadDataSourceImpl(
Get.find<ThreadAPI>(),
Get.find<ThreadIsolateWorker>(),