catchingUnwrapped

inline fun <T> catchingUnwrapped(block: () -> T): Result<T>(source)

Non-fatal-only-catching version of stdlib's runCatching, returning a Result -- Re-throws any fatal exceptions, such as OutOfMemoryError. Re-implements Arrow's nonFatalOrThrow logic to avoid a dependency on Arrow for a single function.


inline fun <T, R> T.catchingUnwrapped(block: T.() -> R): Result<R>(source)

See also