install

fun install(reportNonFatal: (Throwable, Map<String, String>) -> Unit)(source)

Installs the guard on top of the current default uncaught-exception handler.

Install this after Crashlytics has registered its own handler so that this guard wraps it: anything the guard does not recognise is delegated to Crashlytics exactly as before, and the one recognised failure never reaches it as a fatal.

Repeated calls are ignored, so it is safe to call from an android.app.Application subclass that a consumer also initializes manually.

Parameters

reportNonFatal

invoked with the swallowed throwable and diagnostic attributes. It is called on the crashing thread and must not throw.