Skip to content

Errors seem to be swallowed. #1127

@davidjamesstone

Description

@davidjamesstone

I'm new to Nunjucks so please forgive me but I'm finding it very hard to debug when things start going wrong as errors don't seem to propagate up.

Whether it's a syntax error in the template, or a missing template, no errors are raised and and null is returned from the template.render(context) method.

My render pipeline is sync, the only way I've been able to get it to report the error though is to provide an error-first callback to the render method, get the error, then remember to remove the callback after. This is quite frustrating.

I've also tried setting the throwOnUndefined option to true but that doesn't seem to make a difference.

Can anyone shed a light on this? I can provide some example code if needed.

While this is proving to be painful from a dev point of view, my bigger concern is that errors are swallowed in production.

Many thanks

Dave

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions