limiting redirects to 404s

master
Tezza 2015-03-01 14:39:34 +01:00
parent 840ca668a9
commit a4825200a4
1 changed files with 3 additions and 7 deletions

View File

@ -30,14 +30,10 @@
$app->mount( '/events', new level2\EventsControllerProvider() ); $app->mount( '/events', new level2\EventsControllerProvider() );
$app->error(function (\Exception $e, $code) use ( $app ) { $app->error(function (\Exception $e, $code) use ( $app ) {
switch ($code) { if ( $code == 404 ) {
case 404: return $app->redirect('/');
return $app->redirect('/');
default:
$message = 'We are sorry, but something went terribly wrong.';
}
return new Response($message); return new Response($message);
}
}); });
return $app; return $app;