Package 

Class MultiCatchKt

    • Method Summary

      Modifier and Type Method Description
      final static <R extends Any, T extends R> <ERROR CLASS> onException(Result<T> $self, KClass<out Throwable> exceptions, Function1<Throwable, T> transform) Analog of Java multicatch with pipe (|).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onException

         final static <R extends Any, T extends R> <ERROR CLASS> onException(Result<T> $self, KClass<out Throwable> exceptions, Function1<Throwable, T> transform)

        Analog of Java multicatch with pipe (|). Should be used in conjunction with kotlin.runCatching. In case if thrown exception is one of the provided in vararg exceptions param - transform block will be executed. Otherwise exception is re-thrown further in chain.

        Can be chained with other onException blocks.