AsyncExecutionSupport: Don't log CancellationException as error

As of v0.25.0 CancellationException are not processed by
CoroutineExceptionHandler. Until then we need to ignore it explicitly.

Follow-up: IDEA-CR-36112 AsyncExecutionSupport: Adapt to launch/async/withContext API, add tests
This commit is contained in:
Eldar Abusalimov
2018-09-17 11:48:43 +03:00
parent 60dda02405
commit 720e5d29ed
@@ -70,6 +70,7 @@ internal abstract class AsyncExecutionSupport<E : AsyncExecution<E>> : AsyncExec
// MUST NOT throw. See https://github.com/Kotlin/kotlinx.coroutines/issues/562
// #562 "Exceptions thrown by CoroutineExceptionHandler must be caught by handleCoroutineException()"
protected open fun handleUncaughtException(coroutineContext: CoroutineContext, throwable: Throwable) {
if (throwable is CancellationException) return // TODO[eldar] remove once updated to kotlinx.coroutines v0.25.0
try {
LOG.error("Uncaught exception from $coroutineContext", throwable) // throws AssertionError in unit testing mode
}