Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: aggregate libxml2 errors into a single exception #3257

Merged
merged 1 commit into from
Jun 24, 2024

Commits on Jun 24, 2024

  1. feat: aggregate libxml2 errors into a single exception

    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
    flavorjones committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    04001e7 View commit details
    Browse the repository at this point in the history