5407ac1c72
Instead of ExperimentalStdlibApi As a part of efforts to stabilize Native stdlib #KT-55765.
13 lines
346 B
Kotlin
13 lines
346 B
Kotlin
@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class)
|
|
|
|
import kotlin.native.concurrent.freeze
|
|
|
|
// KT-47828
|
|
fun setHookAndThrow() {
|
|
val hook = { _: Throwable ->
|
|
println("OK. Kotlin unhandled exception hook")
|
|
}
|
|
hook.freeze()
|
|
setUnhandledExceptionHook(hook)
|
|
throw Exception("Error")
|
|
} |