diff --git a/lib/features/push_notification/data/datasource_impl/cache_fcm_datasource_impl.dart b/lib/features/push_notification/data/datasource_impl/cache_fcm_datasource_impl.dart index 76668dca8..4ba5d92ca 100644 --- a/lib/features/push_notification/data/datasource_impl/cache_fcm_datasource_impl.dart +++ b/lib/features/push_notification/data/datasource_impl/cache_fcm_datasource_impl.dart @@ -51,9 +51,7 @@ class CacheFCMDatasourceImpl extends FCMDatasource { Future storeSubscription(FCMSubscriptionCache fcmSubscriptionCache) { return Future.sync(() async { return await _firebaseCacheManager.storeSubscription(fcmSubscriptionCache); - }).catchError((error) { - _exceptionThrower.throwException(error); - }); + }).catchError(_exceptionThrower.throwException); } @override diff --git a/lib/main/exceptions/cache_exception_thrower.dart b/lib/main/exceptions/cache_exception_thrower.dart index 852bdca45..488a4742a 100644 --- a/lib/main/exceptions/cache_exception_thrower.dart +++ b/lib/main/exceptions/cache_exception_thrower.dart @@ -1,9 +1,11 @@ +import 'package:core/utils/app_logger.dart'; import 'package:tmail_ui_user/main/exceptions/exception_thrower.dart'; class CacheExceptionThrower extends ExceptionThrower { @override - throwException(dynamic error) { + throwException(dynamic error, dynamic stackTrace) { + logError('CacheExceptionThrower::throwException():error: $error | stackTrace: $stackTrace'); throw error; } } \ No newline at end of file diff --git a/lib/main/exceptions/exception_thrower.dart b/lib/main/exceptions/exception_thrower.dart index 9c21dc60c..175b85a66 100644 --- a/lib/main/exceptions/exception_thrower.dart +++ b/lib/main/exceptions/exception_thrower.dart @@ -1,4 +1,4 @@ abstract class ExceptionThrower { - throwException(dynamic error); + throwException(dynamic error, dynamic stackTrace); } diff --git a/lib/main/exceptions/remote_exception_thrower.dart b/lib/main/exceptions/remote_exception_thrower.dart index cd9b3a8df..f275ad9b3 100644 --- a/lib/main/exceptions/remote_exception_thrower.dart +++ b/lib/main/exceptions/remote_exception_thrower.dart @@ -14,8 +14,8 @@ import 'package:tmail_ui_user/main/routes/route_navigation.dart'; class RemoteExceptionThrower extends ExceptionThrower { @override - throwException(dynamic error) { - logError('RemoteExceptionThrower::throwException():error: $error'); + throwException(dynamic error, dynamic stackTrace) { + logError('RemoteExceptionThrower::throwException():error: $error | stackTrace: $stackTrace'); final networkConnectionController = getBinding(); if (networkConnectionController?.isNetworkConnectionAvailable() == false) { logError('RemoteExceptionThrower::throwException():isNetworkConnectionAvailable');