mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 22:22:16 +00:00
[OPTIMISATION] Optimised exception-message thrown when not using IExceptionHandler interface.
This commit is contained in:
@@ -188,7 +188,7 @@ class RouterBase {
|
|||||||
if($this->request->loadedRoute !== null && $this->request->loadedRoute->exceptionHandler !== null) {
|
if($this->request->loadedRoute !== null && $this->request->loadedRoute->exceptionHandler !== null) {
|
||||||
$handler = new $this->request->loadedRoute->exceptionHandler();
|
$handler = new $this->request->loadedRoute->exceptionHandler();
|
||||||
if(!($handler instanceof IExceptionHandler)) {
|
if(!($handler instanceof IExceptionHandler)) {
|
||||||
throw new RouterException('Exception handler must be instanceof IExceptionHandler.');
|
throw new RouterException('Exception handler must implement the IExceptionHandler interface.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$handler->handleError($this->request, $this->request->loadedRoute, $e);
|
$handler->handleError($this->request, $this->request->loadedRoute, $e);
|
||||||
|
|||||||
Reference in New Issue
Block a user