jvmMain.arrow.throwIfFatal.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arrow-autoclose-jvm Show documentation
Show all versions of arrow-autoclose-jvm Show documentation
Functional companion to Kotlin's Standard Library
package arrow
import kotlin.coroutines.cancellation.CancellationException
@PublishedApi
internal actual fun Throwable.throwIfFatal(): Throwable =
when(this) {
is VirtualMachineError, is ThreadDeath, is InterruptedException, is LinkageError, is CancellationException -> throw this
else -> this
}