Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,16 @@ private static ELException handleJexlException(
detail, line, column);

if (isJexlPermissionViolation(e, allowlistEnabled)) {
throw new ELPermissionException(baseErrorMessage, e);
throw new ELPermissionException(
String.format(
"%s Make sure the JEXL transformation is valid and uses only allowlisted classes, "
+ "methods, and properties.",
baseErrorMessage),
e);
}

return new ELException(baseErrorMessage, e);
return new ELException(
String.format("%s Make sure the JEXL transformation is valid.", baseErrorMessage), e);
}

private static boolean isJexlPermissionViolation(JexlException e, boolean allowlistEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ public void testELPermissionExceptionFailsOnFirstRow() throws Exception {
Assert.assertEquals(0, e.getRowIndex());
Assert.assertEquals(1, e.getDirectiveIndex());
Assert.assertTrue(e.getCause() instanceof ELPermissionException);
Assert.assertTrue(
e.getMessage()
.contains(
"Make sure the JEXL transformation is valid and uses only allowlisted classes, "
+ "methods, and properties."));
Assert.assertTrue(pipeline.errors().isEmpty());
}
}
Expand Down
Loading