From bdac685954e1940272f78a998ad2d93f2d51f679 Mon Sep 17 00:00:00 2001 From: SvyatoslavScherbina Date: Fri, 22 May 2020 13:58:32 +0300 Subject: [PATCH] Add kotlin.coroutines.cancellation.CancellationException to stdlib --- .../kotlin/coroutines/CancellationException.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 runtime/src/main/kotlin/kotlin/coroutines/CancellationException.kt diff --git a/runtime/src/main/kotlin/kotlin/coroutines/CancellationException.kt b/runtime/src/main/kotlin/kotlin/coroutines/CancellationException.kt new file mode 100644 index 00000000000..2d0d62ad432 --- /dev/null +++ b/runtime/src/main/kotlin/kotlin/coroutines/CancellationException.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +package kotlin.coroutines.cancellation + +/** + * Thrown by cancellable suspending functions if the coroutine is cancelled while it is suspended. + * It indicates _normal_ cancellation of a coroutine. + */ +@SinceKotlin("1.4") +public open class CancellationException : IllegalStateException { + constructor() : super() + constructor(message: String?) : super(message) + constructor(message: String?, cause: Throwable?) : super(message, cause) + constructor(cause: Throwable?) : super(cause) +}