create error_404 action and switch default to use it
[catagits/catbook-code.git] / lib / LolCatalyst / Lite / Controller / Root.pm
index 4ee16f6..9d6c5f2 100644 (file)
@@ -12,6 +12,11 @@ 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' );
 }