From 6d0bff144c35c9f2c73f34065e972b3f48a34241 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 23 Jul 2022 03:15:29 +0530 Subject: Begin cleaning up Detekt warnings (#2027) --- .../kotlin/app/passwordstore/util/coroutines/RunSuspendCatching.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'coroutine-utils') diff --git a/coroutine-utils/src/main/kotlin/app/passwordstore/util/coroutines/RunSuspendCatching.kt b/coroutine-utils/src/main/kotlin/app/passwordstore/util/coroutines/RunSuspendCatching.kt index c650c14b..677c2bc3 100644 --- a/coroutine-utils/src/main/kotlin/app/passwordstore/util/coroutines/RunSuspendCatching.kt +++ b/coroutine-utils/src/main/kotlin/app/passwordstore/util/coroutines/RunSuspendCatching.kt @@ -22,8 +22,9 @@ public suspend inline fun runSuspendCatching(block: () -> V): Result T.runSuspendCatching( return try { Ok(block()) + } catch (e: CancellationException) { + throw e } catch (e: Throwable) { - if (e is CancellationException) throw e Err(e) } } -- cgit v1.2.3