Skip to content

Question - No error when filter is unknown #208

@danielmartinezruiz

Description

@danielmartinezruiz

This problem was raised when writing a template and I misspell a filter. This could be an example:

{{ "abc" | uper }}

This is the code I'm executing:

std::string source = R"({{ "abc" | uper }})";
jinja2::Template tpl;
tpl.Load(source);
std::string result = tpl.RenderAsString(ValuesMap{}).value();

I expected to receive an error in the expected return value, but I received a value with an empty string "". In an online Jinja2 parser (I guess it is not using this library) I get this result:

Error:·template·rendering·failed.
no·filter·named·'uper'

So, is that empty string the expected behavior? Am I doing anything wrong?

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