1 /* 2 * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 5 package kotlinx.coroutines 6 7 /** 8 * This exception gets thrown if an exception is caught while processing [CompletionHandler] invocation for [Job]. 9 * 10 * @suppress **This an internal API and should not be used from general code.** 11 */ 12 @InternalCoroutinesApi 13 public class CompletionHandlerException(message: String, cause: Throwable) : RuntimeException(message, cause) 14 15 public expect open class CancellationException(message: String?) : IllegalStateException 16 17 @Suppress("FunctionName", "NO_ACTUAL_FOR_EXPECT") CancellationExceptionnull18public expect fun CancellationException(message: String?, cause: Throwable?) : CancellationException 19 20 internal expect class JobCancellationException( 21 message: String, 22 cause: Throwable?, 23 job: Job 24 ) : CancellationException { 25 internal val job: Job 26 } 27 28 internal class CoroutinesInternalError(message: String, cause: Throwable) : Error(message, cause) 29 addSuppressedThrowablenull30internal expect fun Throwable.addSuppressedThrowable(other: Throwable) 31 // For use in tests 32 internal expect val RECOVER_STACK_TRACES: Boolean 33