Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected <E extends Throwable> void throwIf(Throwable e, Class<E> c) throws E {
- if (e.getCause() != null && c.isInstance(e)) {
- throw (E) e.getCause();
- } else if (e instanceof RuntimeException) {
- throw (RuntimeException) e;
- } else {
- throw new IllegalStateException("Unexpected exception (Yo Dawg!): " + e.getMessage(), e);
- }
- }
Add Comment
Please, Sign In to add comment