Skip to content

Commit 43edeb9

Browse files
committed
Preserve the cause for UserException.
1 parent ec52bb3 commit 43edeb9

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)