diff --git a/src/Pecee/SimpleRouter/Router.php b/src/Pecee/SimpleRouter/Router.php index cbfbfef..fd2affa 100644 --- a/src/Pecee/SimpleRouter/Router.php +++ b/src/Pecee/SimpleRouter/Router.php @@ -443,12 +443,8 @@ public function routeRequest(): ?string } } - } catch (\Throwable $e) { - if ($e instanceof Exception) { - return $this->handleException($e); - } - - return $this->handleException(new Exception($e->getMessage(), $e->getCode())); + } catch (Exception $e) { + return $this->handleException($e); } if ($methodNotAllowed === true) {