From 2b64e8969a79457be63fc15b0409d74651be758e Mon Sep 17 00:00:00 2001 From: Jonathan Treffler Date: Wed, 20 Sep 2023 22:53:02 +0200 Subject: [PATCH] started improving exception handling --- lib/Exceptions/NotFoundException.php | 14 ++++++++++++++ lib/Service/DiffTaskService.php | 7 ++++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 lib/Exceptions/NotFoundException.php diff --git a/lib/Exceptions/NotFoundException.php b/lib/Exceptions/NotFoundException.php new file mode 100644 index 0000000..f08c0ad --- /dev/null +++ b/lib/Exceptions/NotFoundException.php @@ -0,0 +1,14 @@ +getMessage()); + throw new NotFoundException($e->getMessage(), $criteria); } else { throw $e; } @@ -49,7 +50,7 @@ class DiffTaskService { try { return $this->mapper->find($id, $userId); } catch(Exception $e) { - $this->handleException($e); + $this->handleException($e, ["userId" => $userId, "id" => $id]); } }