result Of
Context runner to encapsulate the result of block as a nz.adjmunro.outcome.result.KotlinResult.
If block throws a non-fatal exception, the Throwable is encapsulated as a Result.failure.
If block throws a fatal exception, the Throwable is re-thrown!
For example, CancellationException, which is necessary for Kotlin's structured concurrency model, is considered fatal and will always be rethrown. Read more about issues with Kotlin's
runCatching()
Parameters
The return type of block.
The protected try-block which may throw and exception.
See also
Throws
See Throwable.isFatal for list of unsafe exceptions.
Context runner to encapsulate the result of block as a KotlinResult.
If block throws a non-fatal exception, the Throwable is encapsulated as a Result.failure.
If block throws a fatal exception, the Throwable is re-thrown!
For example, CancellationException, which is necessary for Kotlin's structured concurrency model, is considered fatal and will always be rethrown. Read more about issues with Kotlin's
runCatching()
Parameters
The receiver type of block.
The return type of block.
The protected try-block which may throw and exception.
See also
Throws
See Throwable.isFatal for list of unsafe exceptions.