stevedlawrence commented on a change in pull request #212: Catch error when 
delimiter expression fails
URL: https://github.com/apache/incubator-daffodil/pull/212#discussion_r278657940
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/Evaluatable.scala
 ##########
 @@ -420,6 +421,7 @@ trait ExprEvalMixin[T <: AnyRef]
             expr.evaluate(state)
           } catch {
             case vnv: VariableHasNoValue => doSDE(vnv, state)
+            case pe: ParseError => doSDE(pe, state)
 
 Review comment:
   This doesn't feel right to me for two reasons:
   1. It's valid for expressions to result in ParseErrors, so they shouldn't 
all be made SDEs
   2. I'm not even sure why a ParseError is thrown here. I feel like this 
should be an Assert.invariant or abort or something. I don't think expressions 
should throw ParseErrors to signify an error. In DPath.scala, exceptiosn are 
dealt with in handleThrow and doPE is called to set the state to failure, so 
exceptions/ParseErrors are never thrown from expression. I would expect 
something similar to that to be used for this case.
   
   What is the ParseError that is being thrown in this case?

----------------------------------------------------------------
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