Skip to content

Improve error reporting in template render #4644

@lars-remes

Description

@lars-remes

We have a use case where we render templates that may contain data in array format and we use a filter to process that data when it is rendered.
If we forget the the filter, the template render throws "Array to string conversion" ErrorException in Template.src#359.
This ErrorException thrown flows up until our app catches it, but at that time there is no source context or line number information available.
It would be really helpful is twig could enhance this kind of errors with source context and line like it does for other template rendering errors.

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