aboutsummaryrefslogtreecommitdiff
path: root/coroutine-utils/src
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-07-23 03:15:29 +0530
committerGitHub <noreply@github.com>2022-07-22 21:45:29 +0000
commit6d0bff144c35c9f2c73f34065e972b3f48a34241 (patch)
tree674da15806a0f97641cb90ac3dcc0e96dfe6bcf5 /coroutine-utils/src
parent9a3c18234883d10fb2391e7bad6c06ff4f16f9b3 (diff)
Begin cleaning up Detekt warnings (#2027)
Diffstat (limited to 'coroutine-utils/src')
-rw-r--r--coroutine-utils/src/main/kotlin/app/passwordstore/util/coroutines/RunSuspendCatching.kt6
1 files changed, 4 insertions, 2 deletions
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 <V> runSuspendCatching(block: () -> V): Result<V, Thro
return try {
Ok(block())
+ } catch (e: CancellationException) {
+ throw e
} catch (e: Throwable) {
- if (e is CancellationException) throw e
Err(e)
}
}
@@ -42,8 +43,9 @@ public suspend inline infix fun <T, V> T.runSuspendCatching(
return try {
Ok(block())
+ } catch (e: CancellationException) {
+ throw e
} catch (e: Throwable) {
- if (e is CancellationException) throw e
Err(e)
}
}