From ddaecac0f1110da48a26e4c6750bd024eb9657bd Mon Sep 17 00:00:00 2001 From: Thomas Rubini <74205383+ThomasRubini@users.noreply.github.com> Date: Tue, 24 Jan 2023 09:49:02 +0100 Subject: [PATCH] Implement error handling system --- .../Exceptions/HTTPSpecialCaseException.php | 23 +++++++++++++++++++ Views/errors/400.php | 8 +++++++ Views/errors/403.php | 3 +++ Views/errors/500.php | 8 +++++++ index.php | 12 ++++++++++ 5 files changed, 54 insertions(+) create mode 100644 Kernel/Exceptions/HTTPSpecialCaseException.php create mode 100644 Views/errors/400.php create mode 100644 Views/errors/403.php create mode 100644 Views/errors/500.php diff --git a/Kernel/Exceptions/HTTPSpecialCaseException.php b/Kernel/Exceptions/HTTPSpecialCaseException.php new file mode 100644 index 0000000..9de37b9 --- /dev/null +++ b/Kernel/Exceptions/HTTPSpecialCaseException.php @@ -0,0 +1,23 @@ +httpCode = $httpCode; + $this->msg = $msg; + } + + public function getHTTPCode(){ + return $this->httpCode; + } + + public function getMsg(){ + return $this->code; + } + +} \ No newline at end of file diff --git a/Views/errors/400.php b/Views/errors/400.php new file mode 100644 index 0000000..0f6c905 --- /dev/null +++ b/Views/errors/400.php @@ -0,0 +1,8 @@ +