I could probably just inspect mojo.respond
or mojo.finished
and make the decision based on that, but neither of them is documented which makes me want to avoid them:
$ git grep mojo.respond\nlib/Mojolicious/Renderer.pm: croak 'A response has already been rendered' if $c->stash->{'mojo.respond'}++;\n$ git grep mojo.finished\nlib/Mojolicious/Controller.pm: if (!$stash->{'mojo.finished'} && ++$stash->{'mojo.finished'}) {\n$\n
I assume they're both for internal use only and I'm not supposed to access them directly in application code?
\nPerhaps there's some \"proper\" way to do what I want?
The safe thing to do is to see if the $c->res
has a code
-
I want this: $app->helper('my_app.already_rendered', sub {...});
# Elsewhere
return $log->trace('Response already rendered for action "foo"')
if $c->my_app->already_rendered;
$c->render(...); I could probably just inspect
I assume they're both for internal use only and I'm not supposed to access them directly in application code? |
Beta Was this translation helpful? Give feedback.
-
All |
Beta Was this translation helpful? Give feedback.
-
The safe thing to do is to see if the |
Beta Was this translation helpful? Give feedback.
The safe thing to do is to see if the
$c->res
has acode