Error reporting
Table of contents
Common concepts
TODO:
Parse-time errors
Itβs difficult to write complex template completely without errors. Missed braces, wrong characters, incorrect namesβ¦ Everything is possible. So, itβs crucial to be able to get informative error report from the template engine. Jinja2Cpp provides such kind of report. Template::Load
method (and TemplateEnv::LoadTemplate respectively) return instance of ErrorInfo
class which contains details about the error. These details include:
- Error code
- Error description
- File name and position (1-based line, col) of the error
- Location description
For example, this template:
{{ {'key'=,} }}
produces the following error message:
noname.j2tpl:1:11: error: Expected expression, got: ','
{{ {'key'=,} }}
---^-------
Runtime errors
TODO: