Skip to content

Can only use 'template' inside of a request handler is thrown in middleware #73

@Altai-man

Description

@Altai-man

My code is:

template-location 'templates';

route {
        after {
            template '404.crotmp', hash if .status == 404;
            template '500.crotmp', hash if .status == 500;
        }
...

and accessing it results in:

Can only use 'template' inside of a request handler
  in sub router-plugin-get-configs at /opt/rakudo-pkg/share/perl6/site/sources/BB802F84B227D34EB41F3FA87E22BD753F6E4033 (Cro::HTTP::Router) line 1373

which sounds a bit too restrictive maybe?

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