Guest User

Untitled

a guest
Jul 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public static <E extends Throwable> void unwrapIf(RuntimeException e, Class<E> c) throws E {
  2. if (e.getCause() != null && c.isInstance(e.getCause())) {
  3. // throw (E) e.getCause();
  4. throw new RepositoryException("pouet");
  5. } else if (e instanceof RuntimeException) {
  6. throw e;
  7. } else {
  8. throw new IllegalStateException("Unexpected exception (Yo Dawg!): " + e.getMessage(), e);
  9. }
  10. }
Add Comment
Please, Sign In to add comment