withErrorReporting
suspend fun <E : ErrorEvents> withErrorReporting(eventNotifier: EventNotifier<E>, onError: suspend (error: Throwable) -> Unit?, block: suspend () -> Unit)
Executes the given block, catching any errors and reporting them to the given eventNotifier.
Executes the given block, catching any errors and calling onError, but handling CancellationException.