-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add more descriptive error message for "template not found" error case #4
Comments
Good idea! |
This error message comes from https://github.com/fhd/clostache/blob/master/src/clostache/parser.clj#L375 Currently in mailer, there is no validation check on template resource. There are two options:
I also notice there is another ticket #3. If mailer will switch from clostache to stencil, it is better idea to enhance stencil as well. Note: stencil has slightly different way to find resource, it tries to find resource with/without postfix ".mustache". I can enhance it, but I would like to get your opinion before taking the effort. Thanks. |
We'll be moving away from Clostache. I'm curious if Stencil produces a better error message? |
Not much difference. This is the error coming from Stencil with no template. IllegalArgumentException No implementation of method: :render of protocol: #'stencil.ast/ASTNode found for class: nil clojure.core/-cache-protocol-fn (core_deftype.clj:544) |
OK, I'm all for having a check in Mailer that produces a more indicative message. Feel free to submit a PR. |
Will do. |
If I attempt to refer to a template that doesn't exist, like this
I get following rather cryptic exception:
Something like this would be better:
IllegalArgumentException Template 'templates/email/not-found.moustache' was not found
The text was updated successfully, but these errors were encountered: