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 2018/08/27 18:14:21 UTC

[GitHub] mbeckerle commented on a change in pull request #117: Allow DFDL expressions in the message attribute of asserts/discrimina…

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:
users@infra.apache.org


With regards,
Apache Git Services