stevedlawrence commented on a change in pull request #273: WIP: Add User 
Defined Functions Capability
URL: https://github.com/apache/incubator-daffodil/pull/273#discussion_r334903004
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dpath/Expression.scala
 ##########
 @@ -1870,7 +1870,32 @@ case class FunctionCallExpression(functionQNameString: 
String, expressions: List
       case (RefQName(_, "unsignedByte", XSD), args) =>
         XSConverterExpr(functionQNameString, functionQName, args, 
NodeInfo.UnsignedByte)
 
-      case _ => SDE("Unsupported function: %s", functionQName)
+      case (_: RefQName, args) => {
+        val namespace = functionQName.namespace.toString()
+        val fName = functionQName.local
+
+        val udfCallingInfo = 
UserDefinedFunctionService.lookupUDFCallingInfo(namespace, fName)
+
+        if (udfCallingInfo.isEmpty) {
+          SDE(s"Error calling $namespace:$fName")
 
 Review comment:
   This error message could probably be improved, since it doesn't say what the 
error is. That makes it hard for the user to figure out how to solve the 
problem.
   
   Does it make sense to use the same error message we had when a function was 
not supported? I.e.
   ```scala
   SDE("Unsupported function: %s", functionQName)
   ```
   It's also better to use functionQName instead of namespace + fName. The 
toString method on RefQName knows about prefixes and things and will make a 
more human readable qname.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to