mbeckerle commented on a change in pull request #117: Allow DFDL expressions in 
the message attribute of asserts/discrimina…
URL: https://github.com/apache/incubator-daffodil/pull/117#discussion_r213064667
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/ExpressionEvaluatingParsers.scala
 ##########
 @@ -140,7 +141,16 @@ class AssertExpressionEvaluationParser(
       if (testResult) {
         start.setDiscriminator(discrim)
       } else {
-        // The assertion failed. Prepare a failure message etc. in case 
backtracking ultimately fails from here.
+        val msg =
+          try {
+            msgExpr.evaluate(start)
+          } catch {
+            case e @ (_: ParseError | _: SchemaDefinitionDiagnosticBase) => {
 
 Review comment:
   Same issue here. Should this be catching SDE?
   
   Also, can't this code, which is common to both Pattern and Expression based 
Asserts, be factored into a base trait?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to