-
Notifications
You must be signed in to change notification settings - Fork 25
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
Parsing errors on invalid templates are uncaught, unclear, and unhelpful #42
Comments
When I've managed to trigger tracebacks, they look like this:
|
Proper error messages would definitely be welcome. |
I added support for reporting of lexing and parsing errors in #47, and then more support for render-time errors in #51 (and some more on #52). I also propose to add reference outputs for various error messages in #55. (As mentioned in #55, the error messages I have proposed so far do a reasonable job when the mistake is in the template file, not when the mistake is in the JSON, but this issue is on invalid templates.) The particular example given by @shonfeder, however, is trickier than most and still badly handled with all these PRs. I don't understand all the details, but I think that this is related to the (somewhat unorthodox) way the lexer is setup. ( |
The particular example in this issue, |
A minimal example:
Which crashes with
A first-level fix would be to catch this error and raise something a bit more informative (e.g.,
Invalid_mustache_template
). A better fix would be to identify the location of the syntax error.I'm happy to help with the first part, at least, if that would be welcome.
The text was updated successfully, but these errors were encountered: