You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2019/01/29 19:19:24 UTC

[GitHub] jadams-tresys commented on a change in pull request #176: Add better error message for '/' vs 'div'

jadams-tresys commented on a change in pull request #176: Add better error message for '/' vs 'div'
URL: https://github.com/apache/incubator-daffodil/pull/176#discussion_r251978937
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/dpath/DFDLExpressionParser.scala
 ##########
 @@ -157,7 +157,14 @@ class DFDLPathExpressionParser[T <: AnyRef](qn: NamedQName,
           nextRdr = nextRdr.rest
           i += 1
         }
-        context.SDE("Unable to parse expression. Message: %s\nNext: %s.", msg, nextString.toString())
+        val err_msg = {
+          if (msg.contains('/')) {
+            msg + ", did you mean to use 'div'?"
+          } else {
 
 Review comment:
   While I agree that that is a better solution, it seems to break all the path tests where as my original method doesn't. I'm not entirely sure I understand the code for the UnaryExpr stuff correctly, so it's possible I did something wrong. I'll push up my changes as an example.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services