Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use send_as in template #1712

Closed
abeverley opened this issue Jun 27, 2024 · 1 comment
Closed

Unable to use send_as in template #1712

abeverley opened this issue Jun 27, 2024 · 1 comment
Assignees
Labels

Comments

@abeverley
Copy link
Contributor

This is a follow-on problem as a result of #1622 and its fix 3331ad7

In the highly unlikely event that send_as is called during the render of a template, the error Unable to load serializer class for plain: Can't locate Dancer2/Serializer/plain.pm will be experienced. This is because 3331ad7 removes the longjump when a template is processed, which means statements such as this do not return immediately, leading to unexpected behavior when the subsequent statements are executed.

The use-case here is for the Dancer2::Plugin::LogReport plugin, which (in the worst case scenario if can't do anything else) will render a plain text error if there is an unhandled exception when rendering a template.

I have a proposed solution which I will submit as a separate PR.

@cromedome
Copy link
Contributor

Resolved with merge at 1f913fd. Thanks!

cromedome pushed a commit that referenced this issue Jul 18, 2024
    [ BUG FIXES ]
    * GH #1712: Fix use of send_as in templates (Andy Beverley)

    [ ENHANCEMENTS ]
    * None

    [ DOCUMENTATION ]
    * PR #1706: Document missing logging hooks and log format option;
      fix typo in logging test (Jason A. Crome)

    [ DEPRECATED ]
    * None

    [ MISC ]
    * None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants