From 8c094423312b2581dd3a5f27e3656b3c7323d3db Mon Sep 17 00:00:00 2001 From: Divine Threepwood Date: Tue, 20 Feb 2024 22:15:06 +0100 Subject: [PATCH] fix exception handling in AuthorizationWithTokenHelper to handle user messages --- .../org/openbase/bco/app/preset/DeviceNotificationApp.kt | 4 ++-- .../unit/lib/auth/AuthorizationWithTokenHelper.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/app/preset/src/main/java/org/openbase/bco/app/preset/DeviceNotificationApp.kt b/module/app/preset/src/main/java/org/openbase/bco/app/preset/DeviceNotificationApp.kt index a3bc82873a..6efe6cd635 100644 --- a/module/app/preset/src/main/java/org/openbase/bco/app/preset/DeviceNotificationApp.kt +++ b/module/app/preset/src/main/java/org/openbase/bco/app/preset/DeviceNotificationApp.kt @@ -142,7 +142,7 @@ class DeviceNotificationApp : AbstractAppController() { companion object { private val LOGGER = LoggerFactory.getLogger(TemplateApp::class.java) - private val VALIDATION_PERIOD: Duration = Duration.ofHours(24) - private val INITIAL_VALIDATION_DELAY: Duration = Duration.ofHours(1) + private val VALIDATION_PERIOD: Duration = Duration.ofMinutes(1) + private val INITIAL_VALIDATION_DELAY: Duration = Duration.ofMinutes(1) } } diff --git a/module/registry/unit-registry/lib/src/main/java/org/openbase/bco/registry/unit/lib/auth/AuthorizationWithTokenHelper.kt b/module/registry/unit-registry/lib/src/main/java/org/openbase/bco/registry/unit/lib/auth/AuthorizationWithTokenHelper.kt index 8babea995f..d2b4c4cab7 100644 --- a/module/registry/unit-registry/lib/src/main/java/org/openbase/bco/registry/unit/lib/auth/AuthorizationWithTokenHelper.kt +++ b/module/registry/unit-registry/lib/src/main/java/org/openbase/bco/registry/unit/lib/auth/AuthorizationWithTokenHelper.kt @@ -169,13 +169,13 @@ object AuthorizationWithTokenHelper { null ) } catch (exxx: CouldNotPerformException) { - exceptionStack = - MultiException.push(AuthorizationWithTokenHelper::class.java, exxx, exceptionStack) + exceptionStack = MultiException.push(AuthorizationWithTokenHelper::class.java, exxx, exceptionStack) + null + } ?: let { + MultiException.checkAndThrow({ "Permission denied!" }, exceptionStack) null } } - MultiException.checkAndThrow({ "Permission denied!" }, exceptionStack) - null } } ?: throw FatalImplementationErrorException( "ExceptionStack empty in error case.",