From 98995f7c077311fd89d9cc04b01170f31a61d5c5 Mon Sep 17 00:00:00 2001 From: Kenneth Ezekiel <88850771+KenEzekiel@users.noreply.github.com> Date: Mon, 25 Sep 2023 13:16:13 +0700 Subject: [PATCH] create exceptions --- src/exceptions/BadRequestException.php | 11 +++++++++++ src/exceptions/MethodNotAllowedException.php | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/exceptions/BadRequestException.php create mode 100644 src/exceptions/MethodNotAllowedException.php diff --git a/src/exceptions/BadRequestException.php b/src/exceptions/BadRequestException.php new file mode 100644 index 0000000..fd174a8 --- /dev/null +++ b/src/exceptions/BadRequestException.php @@ -0,0 +1,11 @@ +<?php + + +class BadRequestException extends Exception +{ + // Previous is previous exception that caused this exception to be thrown, so it can be traced and only be intercepted in view layer + public function __construct($message = "", $code = 0, Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} \ No newline at end of file diff --git a/src/exceptions/MethodNotAllowedException.php b/src/exceptions/MethodNotAllowedException.php new file mode 100644 index 0000000..7a2520b --- /dev/null +++ b/src/exceptions/MethodNotAllowedException.php @@ -0,0 +1,10 @@ +<?php + +class MethodNotAllowedException extends Exception +{ + // Previous is previous exception that caused this exception to be thrown, so it can be traced and only be intercepted in view layer + public function __construct($message = "", $code = 0, Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} \ No newline at end of file -- GitLab