java.lang.Object
is.codion.common.utilities.exceptions.Exceptions
Exception handling utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimeExceptionReturns the givenThrowablein case it is a RuntimeException or else a RuntimeException wrapping it.static RuntimeExceptionReturns the givenThrowablein case it is a RuntimeException or else a RuntimeException wrapping it.static Throwableunwrap(Throwable throwable, Collection<Class<? extends Throwable>> unwrap) Unwraps the given throwable.
-
Method Details
-
runtime
Returns the given
Throwablein case it is a RuntimeException or else a RuntimeException wrapping it.Note that if a new wrapper RuntimeException is created, it has the stacktrace of the original throwable, as well as its message, while keeping the original throwable as its cause.
- Parameters:
throwable- the throwable
-
runtime
Returns the given
Throwablein case it is a RuntimeException or else a RuntimeException wrapping it.Note that if a new wrapper RuntimeException is created, it has the stacktrace of the unwrapped throwable, as well as its message, while keeping the unwrapped throwable as its cause.
- Parameters:
throwable- the throwableunwrap- unwraps these exceptions
-
unwrap
Unwraps the given throwable.- Parameters:
throwable- the exception to unwrapunwrap- the exception types to unwrap- Returns:
- the unwrapped exception
-