Skip to content

Commit

Permalink
Avoid unnecessary exception wrapping in JPAConfig
Browse files Browse the repository at this point in the history
1. To preserve the type of the exception, since we react differently to
   ConfigurationException for example.
2. To make testing cleaner.
  • Loading branch information
yrodiere committed Jan 8, 2024
1 parent c0ccfa5 commit c857b76
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public void run() {
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (ExecutionException e) {
throw new RuntimeException(e.getCause());
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause()
: new RuntimeException(e.getCause());
}
}
}
Expand Down

0 comments on commit c857b76

Please sign in to comment.