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

Improve ParsingException by including cursor location when possible #166

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

burdoto
Copy link

@burdoto burdoto commented Mar 29, 2024

Closes #105, Closes #165

This PR introduces the Cursor interface that has methods to gather information about cursor information.
If a Cursor is passed to a ParsingException, the exception message is being appended with line and position information obtained from the Cursor at the moment when the exception is thrown.

Some internal things; such as private helper methods and some (supposedly internal) utility methods from com.electronwill.nightconfig.core.io.Utils had a new, @Nullable parameter added in order to pass a Cursor.

Documentation for added code is still missing.
Hocon tests are failing for a reason outside of this PR.
Needs in-depth testing and new unit tests.

some new parameters were introduced on existing methods, but only on private or internal utility methods; so that should be fine
not sure if this very niche case should be handled at all
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.

Please improve exceptions thrown by the parser Improve error messages
1 participant