Class Throwables
java.lang.Object
com.palantir.ptoss.util.Throwables
A class of utility methods to make exception handling cleaner.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K extends Throwable>
voidthrowIfInstance(Throwable t, Class<K> clazz) if (t instanceof K) throw (K)t;static RuntimeExceptionIf Throwable is a RuntimeException or Error, rethrow it.
-
Method Details
-
throwUncheckedException
If Throwable is a RuntimeException or Error, rethrow it. If not, throw a new PalantirRuntimeException(ex) -
throwIfInstance
-