run Catching Safely
inline suspend fun <T> runCatchingSafely(onException: ExceptionHandler<T>, block: suspend () -> T): Result<T>(source)
Launching block in runCatching. In case of failure, it will:
Try to get ContextSafelyExceptionHandler from current coroutineContext and call its ContextSafelyExceptionHandler.handler invoke. Thrown exception from its handler will pass out of runCatchingSafely
Execute onException inside of new runCatching and return its result. Throws exception will be caught by runCatching and wrapped in Result
Return
Result with result of block if no exceptions or Result from onException execution
inline suspend fun <T, R> R.runCatchingSafely(onException: ExceptionHandler<T>, block: suspend R.() -> T): Result<T>(source)
Launching runCatchingSafely with defaultSafelyExceptionHandler as onException
parameter