public static class Try.Companion
on(kotlin.jvm.functions.Function0<? extends T> body)
public <T> Try<T> on(kotlin.jvm.functions.Function0<? extends T> body)
Executes the given block of code and returns a class Try.Success capturing the result, or a class Try.Failure if a Throwable is thrown.
It is recommended this be chained with Try.throwError to ensure critial Errors are thrown and not captured.