mike-mcgann commented on code in PR #985:
URL: https://github.com/apache/daffodil/pull/985#discussion_r1131698400
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/DFDLSchemaFile.scala:
##########
@@ -92,12 +92,12 @@ class DFDLSchemaFileLoadErrorHandler(schemaFileLocation:
SchemaFileLocation)
}
/**
- * Called on a fatal exception. The parser/validator throws the exception
after
- * this call returns.
+ * Called on a fatal exception and throws the exception
*/
- def fatalError(exception: SAXParseException) = error(
- exception,
- ) // same as non-fatal exception.
+ def fatalError(exception: SAXParseException) = {
+ loaderErrors_ :+= exception
+ throw exception
Review Comment:
This is needed to workaround what appears to be a bug in scala-xml and its
trying to stop it because it is getting caught in that loop. Yes, I wouldn't
expect that behavior and a comment can be added to explain what is going on. I
was just saying that the driver may continue as much as it wants and doesn't
have to throw an exception when the error handler is installed.
As an alternative, we could always keep around the last error seen. If the
next error is exactly the same as the last error, no progress is being made,
and we could throw the exception at that point. That way we can get as many
errors as possible without triggering the infinite loop.
--
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]