sub default :Path {
my ( $self, $c ) = @_;
+ $c->detach('/error_404');
+}
+
+sub error_404 :Private {
+ my ( $self, $c ) = @_;
$c->response->status(404);
$c->response->body( 'Page not found' );
}
-sub translate :Local {
+sub translate :Private {
my ($self, $c) = @_;
my $lol = $c->req->body_params->{lol}; # only for a POST request
# $c->req->params->{lol} would catch GET or POST
my ($self, $c) = @_;
my $errors = scalar @{$c->error};
if ($errors) {
+ $c->log->error("Errors in ${\$c->action}:");
+ $c->log->error($_) for @{$c->error};
$c->res->status(500);
$c->res->body('internal server error');
$c->clear_errors;