From e2849b34b52329eca80cf5166ae7001375440a1c Mon Sep 17 00:00:00 2001 From: Rene Reimann Date: Mon, 13 Jul 2026 16:19:26 +0200 Subject: [PATCH] =?UTF-8?q?feat(S1):=20Add=20typed=20exception=20hierarchy?= =?UTF-8?q?=20=E2=80=94=20ZammadException=20interface=20+=206=20HTTP=20sta?= =?UTF-8?q?tus=20exceptions=20(401,=20404,=20422,=20429,=205xx,=20network)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EPIC-#79 #89 --- src/Exceptions/AuthenticationException.php | 22 ++++++++++++++ src/Exceptions/NetworkException.php | 25 ++++++++++++++++ src/Exceptions/NotFoundException.php | 22 ++++++++++++++ src/Exceptions/RateLimitException.php | 34 ++++++++++++++++++++++ src/Exceptions/ServerErrorException.php | 25 ++++++++++++++++ src/Exceptions/ValidationException.php | 34 ++++++++++++++++++++++ src/Exceptions/ZammadException.php | 25 ++++++++++++++++ 7 files changed, 187 insertions(+) create mode 100644 src/Exceptions/AuthenticationException.php create mode 100644 src/Exceptions/NetworkException.php create mode 100644 src/Exceptions/NotFoundException.php create mode 100644 src/Exceptions/RateLimitException.php create mode 100644 src/Exceptions/ServerErrorException.php create mode 100644 src/Exceptions/ValidationException.php create mode 100644 src/Exceptions/ZammadException.php diff --git a/src/Exceptions/AuthenticationException.php b/src/Exceptions/AuthenticationException.php new file mode 100644 index 0000000..03f6b32 --- /dev/null +++ b/src/Exceptions/AuthenticationException.php @@ -0,0 +1,22 @@ + $errors Detailed per-field validation messages from `details`. + */ + public function __construct( + string $message, + public readonly array $errors = [], + ) { + parent::__construct($message, 422); + } +} diff --git a/src/Exceptions/ZammadException.php b/src/Exceptions/ZammadException.php new file mode 100644 index 0000000..e490aac --- /dev/null +++ b/src/Exceptions/ZammadException.php @@ -0,0 +1,25 @@ +