Package com.palantir.ptoss.util
Class Throwables
java.lang.Object
com.palantir.ptoss.util.Throwables
A class of utility methods to make exception handling cleaner.
- 
Method SummaryModifier 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- 
throwUncheckedExceptionIf Throwable is a RuntimeException or Error, rethrow it. If not, throw a new PalantirRuntimeException(ex)
- 
throwIfInstanceif (t instanceof K) throw (K)t;Note: The runtime type of the thrown exception will be the same as t even if clazz is a supertype of t. - Throws:
- K extends Throwable
 
 
-