X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FLolCatalyst%2FLite%2FController%2FRoot.pm;h=9d6c5f21b6fdc22b1147fe32672d898b05444f80;hb=98cb0f3dfa01407f1f32b4304e8c2f05f5eb0f43;hp=395e4a98cde4d607a9d5aed9b0ae7761c923a88c;hpb=2e909c0da9cbfb35ef78cf2ef48b222dc89f01da;p=catagits%2Fcatbook-code.git diff --git a/lib/LolCatalyst/Lite/Controller/Root.pm b/lib/LolCatalyst/Lite/Controller/Root.pm index 395e4a9..9d6c5f2 100644 --- a/lib/LolCatalyst/Lite/Controller/Root.pm +++ b/lib/LolCatalyst/Lite/Controller/Root.pm @@ -12,11 +12,16 @@ sub index :Path :Args(0) { 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 @@ -38,6 +43,8 @@ sub end : ActionClass('RenderView') { 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;