mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
Updates
- Simplified exception-handling (see demo project for examples). - Optimised sample-project. - Optimised and added further unit-tests. - Optimised and bugfixes.
This commit is contained in:
@@ -21,8 +21,14 @@ class CustomExceptionHandler implements IExceptionHandler {
|
||||
|
||||
// else we just throw the error
|
||||
if($error->getCode() == 404) {
|
||||
die(sprintf('An error occurred (%s):<br/>%s', $error->getCode(), $error->getMessage()));
|
||||
|
||||
// Return 404 path
|
||||
$request->setUri('/404');
|
||||
return $request;
|
||||
|
||||
}
|
||||
|
||||
throw $error;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user