From a49d7c13b62cf342f8de5c920b28b43535a39640 Mon Sep 17 00:00:00 2001 From: sessingo Date: Mon, 24 Apr 2023 20:03:15 +0200 Subject: [PATCH 1/2] Reverted exception handling to old behavior (issue: #660) --- src/Pecee/SimpleRouter/Router.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Pecee/SimpleRouter/Router.php b/src/Pecee/SimpleRouter/Router.php index cbfbfef..dbabbd9 100644 --- a/src/Pecee/SimpleRouter/Router.php +++ b/src/Pecee/SimpleRouter/Router.php @@ -443,11 +443,7 @@ public function routeRequest(): ?string } } - } catch (\Throwable $e) { - if ($e instanceof Exception) { - return $this->handleException($e); - } - + } catch (Exception $e) { return $this->handleException(new Exception($e->getMessage(), $e->getCode())); } From e105f266e30cbc49a285395430578829580ab30a Mon Sep 17 00:00:00 2001 From: sessingo Date: Mon, 24 Apr 2023 20:05:33 +0200 Subject: [PATCH 2/2] Fixed typo --- src/Pecee/SimpleRouter/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pecee/SimpleRouter/Router.php b/src/Pecee/SimpleRouter/Router.php index dbabbd9..fd2affa 100644 --- a/src/Pecee/SimpleRouter/Router.php +++ b/src/Pecee/SimpleRouter/Router.php @@ -444,7 +444,7 @@ public function routeRequest(): ?string } } catch (Exception $e) { - return $this->handleException(new Exception($e->getMessage(), $e->getCode())); + return $this->handleException($e); } if ($methodNotAllowed === true) {