stevedlawrence commented on code in PR #1334:
URL: https://github.com/apache/daffodil/pull/1334#discussion_r1801093360
##########
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/unparsers/runtime1/SpecifiedLengthUnparsers.scala:
##########
@@ -339,6 +339,19 @@ trait KnownPrefixedLengthUnparserMixin {
plElement.setDataValue(java.lang.Integer.valueOf(adjustedLenInUnits.toInt))
+ // do checks on facets expressed on prefixLengthType
+ val optSTRD = plElement.erd.optSimpleTypeRuntimeData
+ if (optSTRD.isDefined) {
+ val strd = optSTRD.get
+ val check = strd.executeCheck(plElement)
+ if (check.isError) {
+ val ue = state.toProcessingError(
+ s"The calculated value of ${prefixedLengthERD.namedQName}
($adjustedLenInUnits) failed check due to ${check.errMsg}"
+ )
+ state.setFailed(ue)
Review Comment:
I'm not sure setFailed does the right thing when unparsing? Uparsing doesn't
have a concept of backtracking so I think any processing errors should be
thrown. I'm not sure setFailed does that. I think most unparsers use the `UE`
function?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]