tryCatch

inline fun <VALUE> tryCatch(block: () -> VALUE): Result<VALUE>

Calls the specified function block and returns Success with encapsulated result if invocation was successful, catching and returning Error with any thrown exception except CancellationException.