You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/03/15 11:56:35 UTC

[GitHub] [daffodil] stevedlawrence commented on a change in pull request #774: Fix invariant broken masking of unparse error.

stevedlawrence commented on a change in pull request #774:
URL: https://github.com/apache/daffodil/pull/774#discussion_r826889805



##########
File path: daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/SequenceChildUnparsers.scala
##########
@@ -107,7 +107,7 @@ abstract class RepeatingChildUnparser(
 
     val actualOccurs = state.arrayPos
 
-    Assert.invariant(state.processorStatus eq Success)
+    // State could be Success or Failure here.

Review comment:
       This function never sets the state to failure, right? Which must mean that some other unparser is setting proessorStatus to Failure? But shouldn't all unparsers immediateyl throw a UE if there is a failure?
   
   I wonder if this means that that some unparser should actually be throwing a UE instead of assumming something else will eventually figure it out and throwing it?
   
   In fact, I found this, which looks suspicious:
   
   https://github.com/apache/daffodil/blob/main/daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/TypeCalculator.scala#L96-L99
   
   That looks like an unparse function that is setting a ParseError as a failure. Seems that that should just be throwing a UE, and is maybe the underlying issue here?




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

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org