1 package kotlinx.coroutines.rx2 2 3 import io.reactivex.functions.* 4 import io.reactivex.plugins.* 5 import kotlinx.coroutines.* 6 import kotlin.coroutines.* 7 8 internal class RxCancellable(private val job: Job) : Cancellable { cancelnull9 override fun cancel() { 10 job.cancel() 11 } 12 } 13 handleUndeliverableExceptionnull14internal fun handleUndeliverableException(cause: Throwable, context: CoroutineContext) { 15 if (cause is CancellationException) return // Async CE should be completely ignored 16 try { 17 RxJavaPlugins.onError(cause) 18 } catch (e: Throwable) { 19 cause.addSuppressed(e) 20 handleCoroutineException(context, cause) 21 } 22 } 23