Skip to content

Commit 9ee08bd

Browse files
committed
Avoid recursive printing of exception causes
`printStackTrace` already recursively prints the causes
1 parent 5cc94b9 commit 9ee08bd

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
@@ -714,11 +714,10 @@ private static void reportUserException(Throwable e, OptionValues parsedHostedOp
714714
} else {
715715
reportUserError(e.getMessage());
716716
}
717-
Throwable current = e.getCause();
718-
while (current != null) {
717+
Throwable cause = e.getCause();
718+
if (cause != null) {
719719
System.out.print("Caused by: ");
720-
current.printStackTrace(System.out);
721-
current = current.getCause();
720+
cause.printStackTrace(System.out);
722721
}
723722
if (parsedHostedOptions != null && NativeImageOptions.ReportExceptionStackTraces.getValue(parsedHostedOptions)) {
724723
System.out.print("Internal exception: ");

0 commit comments

Comments
 (0)