From ee69e4bf38de4b722d20c3155f627f14b0ce8b8b Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Wed, 29 May 2024 09:33:49 +0200 Subject: [PATCH] Catch the exception inside the coroutine scope Sentry reported some uncaught GPlayLoginException exceptions probably because of exception propagation. Let's catch the exception inside the coroutine scope now to be sure the exception is caught. --- .../e/apps/install/splitinstall/SplitInstallBinder.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt b/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt index b4574c653..d24315573 100644 --- a/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt +++ b/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt @@ -68,8 +68,8 @@ class SplitInstallBinder( } override fun installSplitModule(packageName: String, moduleName: String) { - try { - coroutineScope.launch { + coroutineScope.launch { + try { authenticatorRepository.getValidatedAuthData() if (authenticatorRepository.gplayAuth == null) { Timber.w(AUTH_DATA_ERROR_MESSAGE) @@ -77,10 +77,10 @@ class SplitInstallBinder( return@launch } downloadModule(packageName, moduleName) + } catch (exception: GPlayLoginException) { + Timber.w("$AUTH_DATA_ERROR_MESSAGE $exception") + handleError(packageName) } - } catch (exception: GPlayLoginException) { - Timber.w("$AUTH_DATA_ERROR_MESSAGE $exception") - handleError(packageName) } } -- GitLab