Not stopping listening when exception in handling event

This commit is contained in:
Him188 2020-01-01 20:32:08 +08:00
parent 1c316a7ee3
commit 9ad54e46a2

View File

@ -47,8 +47,11 @@ internal class Handler<in E : Subscribable>
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
}
}
}