Package io.servicetalk.utils.internal
Class ThrowableUtils
java.lang.Object
io.servicetalk.utils.internal.ThrowableUtils
Utilities for working with
Throwable
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic Throwable
addSuppressed
(Throwable original, Throwable suppressed) Adds suppressed exception avoiding self-suppression.static Throwable
Combine two potentialThrowable
s into one.static <T> T
Raises an exception bypassing compiler checks for checked exceptions.
-
Method Details
-
throwException
Raises an exception bypassing compiler checks for checked exceptions.- Type Parameters:
T
- The expected type- Parameters:
t
- TheThrowable
to throw.- Returns:
- nothing actually will be returned from this method because it rethrows the specified exception. Making this method return an arbitrary type makes the caller method easier as they do not have to add a return statement after calling this method.
-
combine
Combine two potentialThrowable
s into one. If both parameters areThrowable
, thesecond
one will besuppressed
by thefirst
one. -
addSuppressed
Adds suppressed exception avoiding self-suppression.
-