stevedlawrence 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_r213068637
##########
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:
Regarding the refactoring, I thought about it, but it's such a small amount
of code that is common that it almost seemed like overkill and might just make
things more complicated. I don't feel too strongly about it though.
----------------------------------------------------------------
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