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

Fix #196: move endDocument() call to outside of finally-block #197

Merged
merged 2 commits into from Feb 23, 2024

Conversation

cowtowncoder
Copy link
Member

No description provided.

} catch (XMLStreamException strex) {
throwSaxException(strex);
} catch (Exception e) {
throwSaxException(e);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@winfriedgerlach Ok, I updated this to basically take all Exceptions, including possible SAXParseException, and handle necessary wrapping and error handler calling.

se = (SAXParseException) src;
} else {
se = new SAXParseException(src.getMessage(), /*(Locator)*/ this, src);
ExceptionUtil.setInitCause(se, src);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed unnecessary at first, until I realized that SAXException has its own

private Exception exception;

field separate from cause of JDK Exception (for legacy reasons, I assume).
So this calls is to update cause.

@cowtowncoder cowtowncoder merged commit 92c816e into master Feb 23, 2024
4 of 5 checks passed
@cowtowncoder cowtowncoder deleted the tatu/7.0/196-finally-block-sax branch February 23, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant