Skip to content

Commit

Permalink
Avoid adding the exception itself as a suppressed exception
Browse files Browse the repository at this point in the history
As experienced in quarkusio#30463, it seems it can happen.
  • Loading branch information
gsmet committed Jan 19, 2023
1 parent df60a85 commit cec7cd3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,13 @@ public void interceptTestMethod(Invocation<Void> invocation, ReflectiveInvocatio
runExtensionMethod(invocationContext, extensionContext, true);
invocation.skip();
} catch (Throwable t) {
for (var i : serverExceptions) {
t.addSuppressed(i);
for (var serverException : serverExceptions) {
if (t == serverException) {
// do not add a suppressed exception to itself
continue;
}

t.addSuppressed(serverException);
}
throw t;
} finally {
Expand Down

0 comments on commit cec7cd3

Please sign in to comment.