setUnhandledExceptionHook

Installs an unhandled exception hook and returns an old hook, or null if no user-defined hooks were previously set.

The hook is invoked whenever there is an uncaught exception reaching the boundaries of the Kotlin world, i.e. top-level main(), worker boundary, or when Objective-C to Kotlin call not marked with @Throws throws an exception.

The hook is in full control of how to process an unhandled exception and proceed further. For hooks that terminate an application, it is recommended to use terminateWithUnhandledException to be consistent with a default behaviour when no hooks are set.

Set or default hook is also invoked by processUnhandledException.

Since Kotlin

1.3