Skip to content

Commit f0e8373

Browse files
committed
[GR-50118] Preserve the cause for UserException.
PullRequest: graal/16335
2 parents 33fa7e2 + 43edeb9 commit f0e8373

File tree

1 file changed

+9
-0
lines changed
  • substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/util

1 file changed

+9
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/util/UserError.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ protected UserException(Iterable<String> messages) {
5757
this.messages = messages;
5858
}
5959

60+
public UserException(String msg, Throwable throwable) {
61+
this(Collections.singletonList(msg), throwable);
62+
}
63+
64+
protected UserException(Iterable<String> messages, Throwable throwable) {
65+
super(String.join(System.lineSeparator(), messages), throwable);
66+
this.messages = messages;
67+
}
68+
6069
public Iterable<String> getMessages() {
6170
return messages;
6271
}

0 commit comments

Comments
 (0)