-
Notifications
You must be signed in to change notification settings - Fork 282
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
More structured errors #322
Comments
Can you expand a bit on the errors you want? Both for parsing and rendering stages. I was planning to have a pretty basic error enum since I didn't think people would want specific errors. I thought that in most of the cases I can think of they would just print them and exit, at least for the parsing stage. In the 2 cases linked, why do you need 2 different enum branch to represent them rather than a simple |
It'd be nice to at least have the names of the template with the error and the template that's missing/circular, so maybe a |
But how would you handle differently errors like |
This is for a use-case where I'm loading templates from a database, so I can handle the missing file errors as "check the db for the file and retry if found." |
Ah didn't think of that usecase. I'll have separate enum kinds then. |
Nothing in my usecase needs a more specific error there, but it might be useful to be able to point to a span corresponding to the error? |
Adding spans to the AST is a significant amount of work that I am probably not going to do myself but I would welcome a PR for it |
Errors are now without error-chain in the |
@remexre I pushed some new error types on the v1 branch if you want to try it out |
It'd be nice to be able to get errors more precisely when #234 / #297 gets resolved. For example,
tera/src/tera.rs
Lines 195 to 199 in 97174b7
and
tera/src/tera.rs
Lines 208 to 211 in 97174b7
should return their own enum branch.
The text was updated successfully, but these errors were encountered: