Package 

Class ExceptionKt

    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> T tryOrNull(Function0<T> closure) Returns the result of the given closure, or null if an Exception was raised.
      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.
      final static <T extends Any> T tryOrLog(Function0<T> closure) Returns the result of the given closure, or null if an Exception was raised.
      final static <T extends Throwable> T findInstance(Throwable $self) Finds the first cause instance of the given type.
      final static <R extends Throwable> R findInstance(Throwable $self, Class<R> klass) Finds the first cause instance of the given type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.

      • tryOrLog

         final static <T extends Any> T tryOrLog(Function0<T> closure)

        Returns the result of the given closure, or null if an Exception was raised. The Exception will be logged.