Skip to content

Commit 4db6e74

Browse files
authored
Merge pull request #212 from bulasevich/GR-67898-1
[Backport] [Oracle GraalVM] [GR-67898] Backport to 23.1: Avoid recursive printing of exception causes.
2 parents 561738d + b93544d commit 4db6e74

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
@@ -711,11 +711,10 @@ private static void reportUserException(Throwable e, OptionValues parsedHostedOp
711711
} else {
712712
reportUserError(e.getMessage());
713713
}
714-
Throwable current = e.getCause();
715-
while (current != null) {
714+
Throwable cause = e.getCause();
715+
if (cause != null) {
716716
System.out.print("Caused by: ");
717-
current.printStackTrace(System.out);
718-
current = current.getCause();
717+
cause.printStackTrace(System.out);
719718
}
720719
if (parsedHostedOptions != null && NativeImageOptions.ReportExceptionStackTraces.getValue(parsedHostedOptions)) {
721720
System.out.print("Internal exception: ");

0 commit comments

Comments
 (0)