Dancer2
Dancer2 copied to clipboard
Sub pathname_exists makes debugging hard with the return eval {...} approach
Sub pathname_exists makes debugging hard with the return eval {...} approach . Just spent hours tracking down a problem with a custom login page for Dancer2::Plugin::Auth::Extensible. Turned out to be a rendering problem with the tt file. I strongly suggest a revisit to this method and am providing the following as a starting point to open the discussion...
sub pathname_exists {
my ( $self, $pathname ) = @_;
eval {
# dies if pathname can not be found via TT2's INCLUDE_PATH search
$self->engine->service->context->template( $pathname );
1;
};
if ($@) {
warn $@;
return -1;
}
return 1;
}
Can you submit this as a pull request?
Done