Package ch.raffael.meldioc.util
Class Exceptions
java.lang.Object
ch.raffael.meldioc.util.Exceptions
Some utilities for dealing with exceptions. All these methods make sure
that
fatal exceptions are always rethrown
immediately.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Throwableaccumulate(io.vavr.control.Option<Throwable> current, Throwable exception) Deprecated.static <T> io.vavr.control.Try<T>accumulate(io.vavr.control.Try<T> t, Throwable exception) static Throwableaccumulate(@Nullable Throwable current, Throwable exception) static IllegalFlowalwaysRethrow(Throwable exception) static <T extends Throwable>
IllegalFlowalwaysRethrow(Throwable exception, Class<T> t) static <T extends Throwable>
IllegalFlowalwaysRethrow(Throwable exception, Class<T> t, Function<? super Throwable, ? extends T> wrapper) static <T1 extends Throwable,T2 extends Throwable>
IllegalFlowalwaysRethrow(Throwable exception, Class<T1> t1, Class<T2> t2) static <T1 extends Throwable,T2 extends Throwable, T3 extends Throwable>
IllegalFlowalwaysRethrow(Throwable exception, Class<T1> t1, Class<T2> t2, Class<T3> t3) static <T1 extends Throwable,T2 extends Throwable, T3 extends Throwable>
IllegalFlowalwaysRethrow(Throwable exception, Class<T1> t1, Class<T2> t2, Class<T3> t3, Function<? super Throwable, ? extends T1> wrapper) static <T1 extends Throwable,T2 extends Throwable>
IllegalFlowalwaysRethrow(Throwable exception, Class<T1> t1, Class<T2> t2, Function<? super Throwable, ? extends T1> wrapper) static <E extends Exception>
Exceptions.AutoCloser<E>autoClose(Exceptions.AutoCloser<E> autoCloser) static booleanVirtualMachineErrorandLinkageErrorare considered fatal exceptions that no sane program should try to handle.rethrowIfChecked(E exception, Class<T> t) rethrowIfChecked(E exception, Class<T1> t1, Class<T2> t2) rethrowIfChecked(E exception, Class<T1> t1, Class<T2> t2, Class<T3> t3) static <E extends Throwable>
ErethrowIfFatal(E exception) static <E extends Throwable>
ErethrowIfFatal(E exception, @Nullable Throwable previous) static <E extends Throwable>
ErethrowIfUnchecked(E exception) static Stringstatic String
-
Method Details
-
isFatal
VirtualMachineErrorandLinkageErrorare considered fatal exceptions that no sane program should try to handle. The best reaction to these exceptions is to crash miserably. -
rethrowIfFatal
-
rethrowIfFatal
-
rethrowIfChecked
public static <E extends Throwable,T extends Throwable> E rethrowIfChecked(E exception, Class<T> t) throws T - Throws:
T extends Throwable
-
rethrowIfChecked
-
rethrowIfChecked
-
rethrowIfUnchecked
public static <E extends Throwable> E rethrowIfUnchecked(E exception) throws RuntimeException, Error - Throws:
RuntimeExceptionError
-
alwaysRethrow
-
alwaysRethrow
public static <T extends Throwable> IllegalFlow alwaysRethrow(Throwable exception, Class<T> t) throws T - Throws:
T extends Throwable
-
alwaysRethrow
-
alwaysRethrow
-
alwaysRethrow
public static <T extends Throwable> IllegalFlow alwaysRethrow(Throwable exception, Class<T> t, Function<? super Throwable, ? extends T> wrapper) throws T- Throws:
T extends Throwable
-
alwaysRethrow
-
alwaysRethrow
-
toString
-
toString
-
accumulate
@Deprecated public static Throwable accumulate(io.vavr.control.Option<Throwable> current, Throwable exception) Deprecated. -
accumulate
-
accumulate
-
autoClose
public static <E extends Exception> Exceptions.AutoCloser<E> autoClose(Exceptions.AutoCloser<E> autoCloser)
-