stevedlawrence commented on code in PR #985:
URL: https://github.com/apache/daffodil/pull/985#discussion_r1131657976
##########
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:
> it up to the application to decide whether to throw an exception for
different types of errors and warnings.
This makes me think that we (the application) shouldn't need to throw an
exception to get the behavior we need from Xerces (the driver). The behavior we
want to just add warnings/errors/fatalErrots to a list and then to let the
driver continue gathering errors if it can do so.
And no where does it say the fatalError implementation *must* throw the
exception. If that's actually needed because of a bug in Xerces/Scala
XML/whatever is calling fatalError requires that behavior, we should document
that.
> In other words, a SAX driver class may throw an exception after reporting
any fatalError.
This is what I would expect. Xerces calls fatal error, we handle it and add
the error to our list, and then Xerces throws the exception if can't make
progress OR continues calling error/fatalError more if it can. By throwing an
exception, we are telling Xerces to stop even if it could continue, which I
don't think is what we want--we want as many errors from Xerces as possible.
--
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]