Skip to content

Commit cbe455c

Browse files
Update assertFn to use custom error message
1 parent 78ce14c commit cbe455c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/dashjoin/jsonata/Functions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ public static void error(String message) throws Throwable {
18911891
*/
18921892
public static void assertFn(boolean condition, String message) throws Throwable {
18931893
if(!condition) {
1894-
throw new JException("D3141", -1, "$assert() statement failed");
1894+
throw new JException("D3141", -1, message!=null ? message : "$assert() statement failed");
18951895
// message: message || "$assert() statement failed"
18961896
}
18971897
}

0 commit comments

Comments
 (0)