From 9ad54e46a20fa7b256801c761aaf3daef563ca6d Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 1 Jan 2020 20:32:08 +0800 Subject: [PATCH] Not stopping listening when exception in handling event --- .../event/internal/InternalEventListeners.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/internal/InternalEventListeners.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/internal/InternalEventListeners.kt index ba64793b6..b23bf6e63 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/internal/InternalEventListeners.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/internal/InternalEventListeners.kt @@ -47,8 +47,11 @@ internal class Handler withContext(subscriberContext) { handler.invoke(event) }.also { if (it == ListeningStatus.STOPPED) this.complete() } } catch (e: Throwable) { e.logStacktrace() - this.complete() // do not `completeExceptionally`, otherwise parentJob will fail. - ListeningStatus.STOPPED + // this.complete() // do not `completeExceptionally`, otherwise parentJob will fail. + // ListeningStatus.STOPPED + + // not stopping listening. + ListeningStatus.LISTENING } } }