TtRenderer plugin won't build under Mojolicious 3.05
Closed this issue · 3 comments
the latest version 1.21 of Mojolicious::Plugin::TtRenderer fails install tests under 3.05 but it passes under 3.01
with the environment otherwise identical (through the magic of perlbrew), perl 5.14.2
from .cpanm/build.log...
Failed test '500 Internal Server Error'
at t/lite_app.t line 50.
got: '404'
expected: '500'
Failed test '500 Internal Server Error'
at t/lite_app.t line 75.
got: '404'
expected: '500'
sebastian speculated on the mailing list:
My bet would be on bad tests failing because of this bug fix, but you
should really open a ticket for this.
yeah, makes sense. also, if i --force the install it seems to work ok, and passes my app-specific tests
this isn't just a test problem. any lite app that throws an exception in a .tt template appears to render the exception page correctly but returns a 404 status rather than 500.
the issue only occurs in lite apps (not full Mojolicious apps) and only with versions newer than Mojolicious 3.02
to duplicate:
use Mojolicious::Plugin::TtRenderer;
plugin 'tt_renderer' => {template_options => {PRE_CHOMP => 1, POST_CHOMP => 1, TRIM => 1}};
get '/tt_bad' => 'tt_bad';
@@ tt_bad.html.tt
in tt_good [% h.bogushelper('foo') %]
Returning 1 instead of 0 in the case of error makes the test pass, and it seems to do the right thing.
diff --git a/lib/Mojolicious/Plugin/TtRenderer/Engine.pm b/lib/Mojolicious/Plugin/TtRenderer/Engine.pm index e38b224..96fb65f 100644 --- a/lib/Mojolicious/Plugin/TtRenderer/Engine.pm +++ b/lib/Mojolicious/Plugin/TtRenderer/Engine.pm @@ -93,7 +93,7 @@ sub _render { $c->app->log->error(qq/Template error in "$t": $e/); $c->render_exception($e); $self->tt->error(''); - return 0; + return 1; } return 1;
fixed in 1.22.