From c45cd6347a8d453b3bf3441539faad5930109ad0 Mon Sep 17 00:00:00 2001 From: Juan Antonio Tubio Date: Wed, 11 Oct 2017 16:02:26 +0200 Subject: [PATCH] Added more info on route or method not allowed exception --- src/Pecee/SimpleRouter/Router.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Pecee/SimpleRouter/Router.php b/src/Pecee/SimpleRouter/Router.php index a80073b..d339952 100644 --- a/src/Pecee/SimpleRouter/Router.php +++ b/src/Pecee/SimpleRouter/Router.php @@ -285,7 +285,8 @@ class Router } if ($routeNotAllowed === true) { - $this->handleException(new HttpException('Route or method not allowed', 403)); + $message = sprintf('Route "%s" or method "%s" not allowed.', $this->request->getUri()->getPath(), $this->request->getMethod()); + $this->handleException(new HttpException($message, 403)); } if ($this->request->getLoadedRoute() === null) { @@ -594,4 +595,4 @@ class Router return $this; } -} \ No newline at end of file +}