-
-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: aggregate libxml2 errors into a single exception (#3257)
**What problem is this PR intended to solve?** In places (like document parsing) where it's possible for libxml2 to emit multiple warnings and errors, aggregate these libxml2 errors into a single exception so users can see all the problems. Previously, we were grabbing the most recent "error" which might just be a warning and not the fatal error preventing parsing from completing. This was misleading and hid the source of the real problem. Now, if there are multiple errors, they're aggregated into a single Nokogiri::XML::SyntaxError with a message like: Multiple errors encountered: WARNING: text of warning message ERROR: text of error message WARNING: text of second warning message Note that I've also renamed some internal C functions to try to incrementally get consistent with naming. Closes #2562 **Have you included adequate test coverage?** Yes. **Does this change affect the behavior of either the C or the Java implementations?** It's a cosmetic improvement on the behavior of the CRuby XML and HTML4 parser. I have not made this improvement to the JRuby implementation, but it should be easy enough to add if someone wishes to do the work.
- Loading branch information
Showing
16 changed files
with
279 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.