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


##########
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:
   Ah I see. I thought this was wrapping all exceptions, but misread it. 
   
   In the case I'm wondering if the "user-caused" exceptions (bad input) thrown 
by functions are all proper DruidExceptions? In that case a defensive might 
make sense here. We just want to avoid defensive for anything that isn't a code 
bug on our end.



-- 
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