launchWithHandler

open fun launchWithHandler(block: suspend CoroutineScope.() -> Unit)

Launch suspend block in coroutineScope. Encapsulates this call with try catch block and when an exception is thrown then it is logged in UseCaseErrorHandler.globalOnErrorLogger and handled by defaultErrorHandler.

If exception is CancellationException then defaultErrorHandler is not called and UseCaseErrorHandler.globalOnErrorLogger is called only if the root cause of this exception is not CancellationException (e.g. when Result.getOrCancel is used).