mbeckerle commented on code in PR #1396:
URL: https://github.com/apache/daffodil/pull/1396#discussion_r1895863485
##########
daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala:
##########
@@ -298,7 +298,9 @@ class ProcessorFactory private[japi] (private var pf:
SProcessorFactory)
*/
def onPath(path: String) = {
val dp = pf.onPath(path).asInstanceOf[SDataProcessor]
- new DataProcessor(dp)
+ val res = new DataProcessor(dp)
+ res.isError // ensure all errors have been detected before we return the DP
Review Comment:
Yes, the idea isn't to handle the errors here as the API user may have their
own ideas about when/how to do that. Ex: they may just have an
`assert(!pf.isError)` and just fail out if there are errors because they are
expecting to use well-known-good schemas only.
The purpose of this is just to force all the lazy evaluation to happen
before we return so that we can time things meaningfully. There's no advantage
to the lazy evaluation continuing past this point, so we force it all.
--
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]