private static RuntimeException createRuntimeException(Throwable ex) { return createRuntimeException(ex.getMessage(), ex); }
/** * If Throwable is a RuntimeException or Error, rethrow it. If not, throw a * new PalantirRuntimeException(ex) */ public static RuntimeException throwUncheckedException(Throwable ex) { throwIfInstance(ex, RuntimeException.class); throwIfInstance(ex, Error.class); throw createRuntimeException(ex); }