Package io.servicetalk.utils.internal
Class ThrowableUtils
java.lang.Object
io.servicetalk.utils.internal.ThrowableUtils
Utilities for working with
Throwables.-
Method Summary
Modifier and TypeMethodDescriptionstatic ThrowableaddSuppressed(Throwable original, Throwable suppressed) Adds suppressed exception avoiding self-suppression.static ThrowableCombine two potentialThrowables into one.static <T> TRaises 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- TheThrowableto 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 potentialThrowables into one. If both parameters areThrowable, thesecondone will besuppressedby thefirstone. -
addSuppressed
Adds suppressed exception avoiding self-suppression.
-