-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 error message for unmatched input #214
Comments
We can improve error messages by implementing code blocks as described here: mna/pigeon#18 (comment). |
tsandall
added a commit
to tsandall/opa
that referenced
this issue
Aug 29, 2017
The new version of mna/pigeon fixes the location bug that prevented accurate line/column numbers from being reported on unmatched input. In the future we can investigate improvements to the error messages by adding negative matches that return higher-level errors as long as the location information is not impacted. Fixes open-policy-agent#214
tsandall
added a commit
that referenced
this issue
Aug 29, 2017
The new version of mna/pigeon fixes the location bug that prevented accurate line/column numbers from being reported on unmatched input. In the future we can investigate improvements to the error messages by adding negative matches that return higher-level errors as long as the location information is not impacted. Fixes #214
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the parser fails to find a matching rule, it stops immediately and returns an error message as follows:
It would be nice if the error message contained more context such as the surrounding text.
In some cases, the error message is slightly misleading, for instance:
test.rego:
error:
The floating point number doesn't parse however because of how expressions are matched, it fails at
>
.It's possible the parser rules could be restructured to improve error handling however this seems like something the parser should be able to deal with.
Creating this ticket as a placeholder for more investigation into improvements.
The text was updated successfully, but these errors were encountered: