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

[TIKA-2328] Improved error handling for HtmlParser errors with unbalanced quotes #1310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yakovsh
Copy link

@yakovsh yakovsh commented Aug 29, 2023

This PR improves error handling by re-throwing the error as a TikaException instead of the unexpected StringsOutOfBoundsException.

Tests for "tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-html-module" run without issues.

I have a signed ICLA with Apache.

parser.parse(reader.asInputSource());
try {
parser.parse(reader.asInputSource());
} catch (StringIndexOutOfBoundsException e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@tballison - any thoughts on Tika's general strategy for what errors get returned by parsers? E.g. is the trend towards always throwing a TikaException, versus more specific errors?

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.

2 participants