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 parser error messages #32

Merged
merged 2 commits into from
Aug 5, 2024
Merged

Conversation

braised-babbage
Copy link
Collaborator

This attempts to report information about ANTLR failures, when this information is available. Docs for the antlr4 Python implementation are a bit spotty, but at least in the Java version the BailErrorStrategy will result in a ParseCancellationException that carries more specific information in its arguments. My experience has been that it is easy to provide a message indicating where this failure is noticed, although this may not be the root cause of the parse failure.

The changes in this PR assume that OpenPulseParsingError is user-facing, so that putting information in a human-readable message is appropriate. Alternatively I could imagine adding a field to the exception to carry this information.

Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

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

Looks like a nice small improvement.

@braised-babbage braised-babbage merged commit cbf6e72 into main Aug 5, 2024
11 checks passed
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