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