Skip to main content

Jinja2 Extension for Raise Error

Project description

PyPI Package PyPI Python Versions PyPI Package License

Jinja2 Extension for Raise Error


jinja2_error is available for download from PyPI via pip:

$ pip install jinja2_error

It will automatically install jinja2 along with arrow.


Error Tag

The extension comes with a error tag that provides convenient to raise error`.

def test_raise_error(self):
    env = Environment(extensions=[ErrorExtension])
    render_text = """
    {% if 1==1 %}
      {% error "It's error" %}
    {% endif %}
    template = env.from_string(render_text)
    self.assertRaises(TemplateRuntimeError, template.render, {"a": "b"})

Ansible Template Usage

ANSIBLE_JINJA2_EXTENSIONS=jinja2_error.ErrorExtension ansible-playbook site.yml -vvv


If you encounter any problems, please file an issue along with a detailed description.

Code of Conduct

Everyone interacting in the jinja2_error project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PyPA Code of Conduct.


Distributed under the terms of the MIT license, jinja2_error is free and open source software

OSI certified

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jinja2-error, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size jinja2_error-0.1.0-py3-none-any.whl (3.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size jinja2_error-0.1.0.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page