GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Jinja2C++ project
  • Getting Started
  • Jinja2C++ Usage
  • Basic Features
  • Main statements
  • 'extends' Statement
  • Macros
  • 'include' and 'import'
  • Reflection
  • User-defined Callables
  • Error Reporting
  • Build and Install
  • Changelog
  • API Reference

This view

  • Original page
  • New address

GeezerVison is showing jinja2cpp.github.io — Error Reporting

Error reporting

Table of contents

  1. Common concepts
  2. Parse-time errors
  3. Runtime errors

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:

< Prev | Up | Next >

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.