Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Exceptions improvement

  • Loading branch information...
commit 79415c78466beb0a4e67f2ee00d5d9c0943b281c 1 parent 4ddddf6
Zbigniew Lukasiak authored
View
4 extensions/WebNano-Renderer-TT/lib/WebNano/Renderer/TT.pm
@@ -47,7 +47,9 @@ sub render {
}
}
$self->INCLUDE_PATH( \@path );
- $self->_tt->process( $params{template}, $params{vars}, $params{output} );
+ my $tt = $self->_tt;
+ $tt->process( $params{template}, $params{vars}, $params{output} )
+ || die $tt->error();;
}
1;
View
1  lib/WebNano.pm
@@ -26,6 +26,7 @@ sub handle {
my $path = $env->{PATH_INFO};
my $c_class = $self->find_nested( '', $self->controller_search_path );
$path =~ s{^/}{};
+ die 'Cannot find root controller' if !$c_class;
my $out = $c_class->handle(
path => $path,
application => $self,
View
9 lib/WebNano/Controller.pm
@@ -33,16 +33,13 @@ sub render {
#warn 'render in ' . ref($self) . ' with self_path: ' . $self->self_path;
my $path = $self->self_path;
$path =~ s{^/}{};
- if( $t->render(
+ $t->render(
template => $template,
search_path => [ $path, @{ $self->template_search_path } ],
vars => $vars,
output => \$out
- )
- ){
- return $out;
- }
- die $t->error;
+ );
+ return $out;
}
sub external_dispatch {
Please sign in to comment.
Something went wrong with that request. Please try again.