Skip to content

Commit 26e3cc8

Browse files
committed
[GR-60383] Avoid recursive printing of exception causes
PullRequest: graal/19548
2 parents 88008ba + 9ee08bd commit 26e3cc8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageGeneratorRunner.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,11 +715,10 @@ private static void reportUserException(Throwable e, OptionValues parsedHostedOp
715715
} else {
716716
reportUserError(e.getMessage());
717717
}
718-
Throwable current = e.getCause();
719-
while (current != null) {
718+
Throwable cause = e.getCause();
719+
if (cause != null) {
720720
System.out.print("Caused by: ");
721-
current.printStackTrace(System.out);
722-
current = current.getCause();
721+
cause.printStackTrace(System.out);
723722
}
724723
if (parsedHostedOptions != null && NativeImageOptions.ReportExceptionStackTraces.getValue(parsedHostedOptions)) {
725724
System.out.print("Internal exception: ");

0 commit comments

Comments
 (0)