corda / net.corda.core.utilities / Try / on

on

@JvmStatic inline fun <T> on(body: () -> T): Try<T>

Executes the given block of code and returns a Success capturing the result, or a Failure if a Throwable is thrown.

It is recommended this be chained with throwError to ensure critial Errors are thrown and not captured.