From af54ecb61e81370616c89c7b6282970e6e1d3689 Mon Sep 17 00:00:00 2001 From: Brandon Fergerson Date: Fri, 2 Sep 2022 20:21:27 +0400 Subject: [PATCH] fix: ignore CancellationException --- common/src/main/kotlin/spp/jetbrains/ScopeExtensions.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/src/main/kotlin/spp/jetbrains/ScopeExtensions.kt b/common/src/main/kotlin/spp/jetbrains/ScopeExtensions.kt index 8f7f9bc60..f6f0cab2c 100644 --- a/common/src/main/kotlin/spp/jetbrains/ScopeExtensions.kt +++ b/common/src/main/kotlin/spp/jetbrains/ScopeExtensions.kt @@ -57,7 +57,12 @@ object ScopeExtensions { ): Deferred<*> { return GlobalScope.async { safeExecute { - action() + try { + action() + } catch (ignored: CancellationException) { + } catch (throwable: Throwable) { + log.error(throwable) + } } } }