withErrorReporting

suspend fun <E : ErrorEvents> withErrorReporting(eventNotifier: EventNotifier<E>, onError: suspend (error: Throwable) -> Unit?, block: suspend () -> Unit)
inline fun <E : ErrorEvents> withErrorReporting(eventNotifier: EventNotifier<E>, block: () -> Unit)

Executes the given block, catching any errors and reporting them to the given eventNotifier.


inline fun withErrorReporting(onError: (error: Throwable) -> Unit, block: () -> Unit)

Executes the given block, catching any errors and calling onError, but handling CancellationException.