stevedlawrence commented on code in PR #985:
URL: https://github.com/apache/daffodil/pull/985#discussion_r1132332675


##########
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:
   > As an alternative, we could always keep around the last error seen...
   
   It's probably not worth the added complexity, I think just commenting about 
why we have the throw an limitations (e.g. maybe don't get as many errors as 
possible) is fine.
   
   Also, I grepped through the scala-xml code and couldn't find any calls to 
`fatalError`. I wonder if under the hood it's just using Xerces or some Java 
built-in XML parser, and the issue is actually in that parser and not in 
scala-xml. Can you output a stack trace? It would be nice to open a ticket with 
whatever is doing this and see if it could be fixed.



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

Reply via email to