-
Notifications
You must be signed in to change notification settings - Fork 48
Improve UndefinedVariableError and UndefinedFilterError error messages #180
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 UndefinedVariableError and UndefinedFilterError error messages #180
Conversation
aa82067 to
2bcdea5
Compare
|
Fixed a typo in commit message |
| def message(exception) do | ||
| variable = exception.variable | ||
|
|
||
| variable_name = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we might be able to simply use variable.original_name here. It will account for all the weird ways that you can write a variable:
{{ post.text }}
vs
{{ post["text"] }}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I am going to look into that! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thanks for the PR!! 🎉 |
|
I took the liberty and updated the changelog, which I forgot to do originally. I included a line for my earlier merged PR c9fba28. I hope you don't mind, that I bundled it with this PR. It's in a separate commit, tho. |
0f0de08 to
51c01a7
Compare
|
I rebased the branch to resolve merge conflicts |
|
Thanks for updating the changelog! Appreciated! There is one flaky test related to printing time that I have to fix. This was the reason why the build failed. Will release a new version soon! ❤️ |
edgurgel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Thank you! 🎉 Will release a new version later in the week! |

The goal of the first commit is to fix the Solid.UndefinedVariableError exception message that did not account for multiple variable names and thus rendering them all in a single word, for example:
A template such as
{{ user.properties.email }}would show the following error when strict_variables is set to true:Undefined variable userpropertiesemailafter the fix, the error message is
Undefined variable user.properties.emailThe second commit unifies the Solid.UndefinedFilterError error message with the UndefinedVariableError one by including the line number.