mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 18:02:09 +00:00
@@ -89,9 +89,9 @@ class RouterBase {
|
|||||||
$route->renderRoute($this->request);
|
$route->renderRoute($this->request);
|
||||||
$mergedSettings = array_merge($settings, $route->getMergeableSettings());
|
$mergedSettings = array_merge($settings, $route->getMergeableSettings());
|
||||||
|
|
||||||
// Add exceptionhandler
|
// Add ExceptionHandler
|
||||||
if($route->matchRoute($this->request) && $route->getExceptionHandler() !== null) {
|
if($route->matchRoute($this->request) && $route->getExceptionHandler() !== null) {
|
||||||
$this->exceptionHandlers[] = $route->getExceptionHandler();
|
$this->exceptionHandlers[] = $route;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,8 +178,12 @@ class RouterBase {
|
|||||||
|
|
||||||
protected function handleException(\Exception $e) {
|
protected function handleException(\Exception $e) {
|
||||||
|
|
||||||
foreach ($this->exceptionHandlers as $handler) {
|
/* @var $route RouterEntry */
|
||||||
$handler = new $handler($this->request);
|
foreach ($this->exceptionHandlers as $route) {
|
||||||
|
$route->loadMiddleware($this->request);
|
||||||
|
$handler = $route->getExceptionHandler();
|
||||||
|
$handler = new $handler();
|
||||||
|
|
||||||
if (!($handler instanceof IExceptionHandler)) {
|
if (!($handler instanceof IExceptionHandler)) {
|
||||||
throw new RouterException('Exception handler must implement the IExceptionHandler interface.');
|
throw new RouterException('Exception handler must implement the IExceptionHandler interface.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user