|
@@ -148,7 +148,7 @@ class Coroutine<T>(
|
|
|
success?.let { dispatchCallback(this, value, it) }
|
|
success?.let { dispatchCallback(this, value, it) }
|
|
|
} catch (e: Throwable) {
|
|
} catch (e: Throwable) {
|
|
|
e.printOnDebug()
|
|
e.printOnDebug()
|
|
|
- if (e is CancellationException && !isActive && e !is ActivelyCancelException) {
|
|
|
|
|
|
|
+ if (e is CancellationException && e !is ActivelyCancelException && isCancelled) {
|
|
|
this@Coroutine.cancel()
|
|
this@Coroutine.cancel()
|
|
|
}
|
|
}
|
|
|
val consume: Boolean = errorReturn?.value?.let { value ->
|
|
val consume: Boolean = errorReturn?.value?.let { value ->
|
|
@@ -159,9 +159,7 @@ class Coroutine<T>(
|
|
|
error?.let { dispatchCallback(this, e, it) }
|
|
error?.let { dispatchCallback(this, e, it) }
|
|
|
}
|
|
}
|
|
|
} finally {
|
|
} finally {
|
|
|
- withContext(NonCancellable) {
|
|
|
|
|
- finally?.let { dispatchVoidCallback(this, it) }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ finally?.let { dispatchVoidCallback(this, it) }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|