-
public final class ExceptionKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> TtryOrNull(Function0<T> closure)Returns the result of the given closure, or null if an Exception was raised. final static <T extends Any> TtryOr(T default, Function0<T> closure)Returns the result of the given closure, or default if an Exception was raised. final static <T extends Any> TtryOrLog(Function0<T> closure)Returns the result of the given closure, or null if an Exception was raised. final static <T extends Throwable> TfindInstance(Throwable $self)Finds the first cause instance of the given type. final static <R extends Throwable> RfindInstance(Throwable $self, Class<R> klass)Finds the first cause instance of the given type. -
-
Method Detail
-
tryOrNull
final static <T extends Any> T tryOrNull(Function0<T> closure)
Returns the result of the given closure, or null if an Exception was raised.
-
tryOr
final static <T extends Any> T tryOr(T default, Function0<T> closure)
Returns the result of the given closure, or default if an Exception was raised.
-
findInstance
final static <T extends Throwable> T findInstance(Throwable $self)
Finds the first cause instance of the given type.
-
findInstance
final static <R extends Throwable> R findInstance(Throwable $self, Class<R> klass)
Finds the first cause instance of the given type.
-
-
-
-