Keats / tera

A template engine for Rust based on Jinja2/Django
http://keats.github.io/tera/
MIT License
3.43k stars 279 forks source link

How to find the exact line and column in a Tera Error? #858

Open lquerel opened 11 months ago

lquerel commented 11 months ago

I am trying to pinpoint the exact location of an error during the rendering of a tera template. An example of error message I received is as follows:

Variable `id` not found in context while rendering 'example.tera'

I am looking for a method to derive the exact line and column where the error originated. Unfortunately, I haven't been able to extract this detailed information from the error structure as well.

Can anyone provide guidance or tips on how I might locate the precise location of this error in the template? Any help would be greatly appreciated.

Keats commented 11 months ago

It's not tracked in v1 but is in v2. You would need to wait for v2 to be released to get it.

lquerel commented 11 months ago

Ok. Do you have an approximate idea of when version 2 will be available?

Keats commented 11 months ago

No clue. The happy path and some error handling is mostly done (https://github.com/Keats/tera2) it's missing error handling for rendering and filters/functions/tests but I've started paternity leave yesterday so I don't know when I'll get to it