KES777 / mojo

Mojolicious - Perl real-time web framework
http://mojolicio.us
Artistic License 2.0
0 stars 0 forks source link

snapshot is not settted up for first call for 'before_render' hoook #10

Open KES777 opened 7 years ago

KES777 commented 7 years ago
First call to 'before_render' callback when exception occur does not have $c->stash->{ snapshot } defined (when 'exception.development' template is tried). Following calls has (when 'exception', 'mojo/debug' are tried) in contrary $_[1]->{ snapshot } is defined for all those cases
KES777 commented 7 years ago
is this expected that { snapshot } is not defined? ah, I have found. That is because of $c->render_maybe implicitly sets up stash keys which are consistent between calls http://paste.scsys.co.uk/540704 and stash should be localized here: https://github.com/KES777/mojo/blob/master/lib/Mojolicious/Controller.pm#L169 in same way as it is localized when { mojo.string }: https://github.com/KES777/mojo/blob/master/lib/Mojolicious/Renderer.pm#L83