Fixed double TT rendering on error

If a template produced a rendering error in process() but did not produce one
when called without stash variables, the Mojo::Exception would be built
incorrectly, leading to an exception that masked the original error.
This commit is contained in:
Matthias Bethke
2012-05-17 14:00:17 -06:00
parent b3c64c75d4
commit 989ea57cf9
2 changed files with 8 additions and 5 deletions
+1 -3
View File
@@ -85,9 +85,7 @@ sub _render {
# Error
unless ($ok) {
my $e = Mojo::Exception->new(
$self->tt->error.'',
$self->tt->service->process(defined $inline ? \$inline : $t));
my $e = Mojo::Exception->new($self->tt->error.'');
$$output = '';
$c->app->log->error(qq/Template error in "$t": $e/);
$c->render_exception($e);