gianm commented on code in PR #14987:
URL: https://github.com/apache/druid/pull/14987#discussion_r1330173845


##########
processing/src/main/java/org/apache/druid/math/expr/FunctionalExpr.java:
##########
@@ -186,7 +187,15 @@ public String toString()
   @Override
   public ExprEval eval(ObjectBinding bindings)
   {
-    return function.apply(args, bindings);
+    try {
+      return function.apply(args, bindings);
+    }
+    catch (DruidException | ExpressionValidationException e) {
+      throw e;
+    }
+    catch (Exception e) {
+      throw DruidException.defensive().build(e, "Invocation of function '%s' 
encountered exception.", name);

Review Comment:
   I think some other category would make more sense than "defensive". 
Defensive is sort of like an assert (it signals that we believe this should 
never happen unless there's a bug) but we do in fact expect functions to throw 
exceptions under "normal" conditions sometimes. (Like if they receive arguments 
of the wrong type, etc)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to