Skip to content

Commit

Permalink
Merge pull request #16440 from gsmet/avoid-exception-wrapping
Browse files Browse the repository at this point in the history
Avoid unnecessary exception wrapping in NativeTestExtension.throwBootFailureException
  • Loading branch information
gsmet authored Apr 12, 2021
2 parents 923ee07 + 2a46b63 commit 0487ff2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ public void postProcessTestInstance(Object testInstance, ExtensionContext contex
}
}

private void throwBootFailureException() {
private void throwBootFailureException() throws Exception {
if (firstException != null) {
Throwable throwable = firstException;
firstException = null;

if (throwable instanceof Exception) {
throw (Exception) throwable;
}

throw new RuntimeException(throwable);
} else {
throw new TestAbortedException("Boot failed");
Expand Down

0 comments on commit 0487ff2

Please sign in to comment.