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

Report error context with a customisable length #13

Closed
MaxDesiatov opened this issue Dec 3, 2018 · 1 comment
Closed

Report error context with a customisable length #13

MaxDesiatov opened this issue Dec 3, 2018 · 1 comment
Assignees

Comments

@MaxDesiatov
Copy link
Collaborator

MaxDesiatov commented Dec 3, 2018

As reported in CoreOffice/CoreXLSX#12 there are multiple issues where it's hard to understand why parsing of a certain XML has failed. XMLCoder should be able to report a snippet of a given XML of specified length around the position where the error has happened. This should be an property of type Int? named errorContextLength on XMLDecoder instance. An error thrown from XML parser that has line/column location should be repackaged having a context around that location of specified length.

For example, if an error was thrown indicating that there's an unexpected character at line 3, column 15 with errorContextLength set to 10, a new error type should be rethrown containing 5 characters before column 15 and 5 characters after, all on line 3. Line wrapping should be handled correctly too as the context can span more than a few lines.

@MaxDesiatov
Copy link
Collaborator Author

Reopening this after a few bugs were reported in a corresponding PR.

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

No branches or pull requests

2 participants