limiting redirects to 404s
parent
840ca668a9
commit
a4825200a4
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue