Package 

Class ExceptionKt

  • All Implemented Interfaces:

    
    public final class ExceptionKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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 Any> T asInstance(Throwable $self) Finds the first cause instance of the given type.
      final static <R extends Any> R asInstance(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
    • Constructor Detail

    • 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.

      • asInstance

         final static <T extends Any> T asInstance(Throwable $self)

        Finds the first cause instance of the given type.

      • asInstance

         final static <R extends Any> R asInstance(Throwable $self, Class<R> klass)

        Finds the first cause instance of the given type.