runWrappingAs

inline fun <E : Throwable, T> runWrappingAs(a: (String?, Throwable) -> E, block: () -> T): T(source)

Runs the block. If any non-fatal exception is thrown, ensure that it is of the provided type.

Usage: runWrappingAs(a = ::ThrowableType) { ... }


inline fun <E : Throwable, T> runWrappingAs(a: (Throwable) -> E, block: () -> T): T(source)

See also