diff --git a/route.php b/route.php index e52835b..a7bb3ff 100644 --- a/route.php +++ b/route.php @@ -296,7 +296,7 @@ class route } if (!isset ($_SERVER["REQUEST_METHOD"])) - throw new Exception ("No REQUEST_METHOD", 415); + $this->error (new \Exception ("No REQUEST_METHOD", 415)); if ($_SERVER["REQUEST_METHOD"] === "GET" || $_SERVER["REQUEST_METHOD"] === "POST" || $_SERVER["REQUEST_METHOD"] === "PUT" || @@ -306,7 +306,7 @@ class route return $_SERVER["REQUEST_METHOD"]; } - throw new Exception ("Invalid REQUEST_METHOD", 406); + $this->error (new \Exception ("Invalid REQUEST_METHOD", 406)); } /** Return the mached route search @@ -492,8 +492,8 @@ class route if ($rcRegex === false) { if (count (error_get_last())) - throw new \Exception ("Invalid regex provided: $regex : ". - error_get_last()["message"], 500); + $this->error (new \Exception ("Invalid regex provided: $regex : ". + error_get_last()["message"], 500)); } if ($rcRegex !== FALSE && $rcRegex !== 0) {