mbeckerle commented on a change in pull request #204: Provide more detail for 
failed assertions
URL: https://github.com/apache/incubator-daffodil/pull/204#discussion_r270946114
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/ExpressionEvaluatingParsers.scala
 ##########
 @@ -143,7 +143,9 @@ class AssertExpressionEvaluationParser(
         start.setDiscriminator(discrim)
       } else {
         val message = getAssertFailureMessage(start)
-        val diag = new AssertionFailed(decl.schemaFileLocation, start, message)
+        val currentElem = start.infoset
+        val details = "\nParsed value was: " + currentElem.toString
 
 Review comment:
   Can this toString possibly fail? 
   I think there should be Assert.invariant checks here which check explicitly 
the assumptions you are making that reassure you that this toString cannot 
fail, i.e., that a currentElem exists, that if it is of simple type, then it 
positively does have a value always by this point. 

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


With regards,
Apache Git Services

Reply via email to