Skip to content

FilterArgumentError exception is not documented and not in the "jinja2" module #2172

Description

@andy-maier

The documentation at https://jinja.palletsprojects.com/en/stable/ documents all public exceptions in the jinja2.exceptions module, except for FilterArgumentError.

When I ask Claude what exception should be returned from Jinja2 filters in case of invalid arguments, it refers to FilterArgumentError.

When I scan the filters provided by Jinja2 itself for what they return in case of invalid arguments, it is FilterArgumentError.

I do realize that there is an asymmetry between filter and test plugins w.r.t. this exception (i.e. there is no TestArgumentError), and Ansible has similar asymmetries between filters and tests.

However, I think from a pragmatic and compatibility perspective, FilterArgumentError should be treated as a first class citizen exception, and should be documented and made visible in the jinja2 top level module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions