From e25cd4378e1b672a665fa770d01960620e9bf63e Mon Sep 17 00:00:00 2001 From: Sanket Sahu Date: Tue, 29 Sep 2026 06:41:51 +0000 Subject: [PATCH] fix: restore JEXL allowlist explanation in error message --- .../src/main/java/io/cdap/wrangler/expression/EL.java | 10 ++++++++-- .../wrangler/executor/RecipePipelineExecutorTest.java | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java b/wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java index 0457567a9..c4406cd01 100644 --- a/wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java +++ b/wrangler-core/src/main/java/io/cdap/wrangler/expression/EL.java @@ -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) { diff --git a/wrangler-core/src/test/java/io/cdap/wrangler/executor/RecipePipelineExecutorTest.java b/wrangler-core/src/test/java/io/cdap/wrangler/executor/RecipePipelineExecutorTest.java index e64be8d94..fc777e70b 100644 --- a/wrangler-core/src/test/java/io/cdap/wrangler/executor/RecipePipelineExecutorTest.java +++ b/wrangler-core/src/test/java/io/cdap/wrangler/executor/RecipePipelineExecutorTest.java @@ -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()); } }