diff options
author | dartcafe <github@dartcafe.de> | 2020-06-14 13:15:00 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-06-14 13:15:00 +0300 |
commit | c6d2e376387755e10d6c4bf4107a14e65a3a5886 (patch) | |
tree | 65cae4bd1605224c4cc080132ada21b828ced1df /lib/Controller/CommentController.php | |
parent | 734c217253323caa202e257b5187736ec28419ec (diff) |
comment changed error handling
Diffstat (limited to 'lib/Controller/CommentController.php')
-rw-r--r-- | lib/Controller/CommentController.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Controller/CommentController.php b/lib/Controller/CommentController.php index 8e5f8680..84cfd01a 100644 --- a/lib/Controller/CommentController.php +++ b/lib/Controller/CommentController.php @@ -107,8 +107,10 @@ class CommentController extends Controller { public function delete($commentId, $token) { try { return new DataResponse($this->commentService->delete($commentId, $token), Http::STATUS_OK); - } catch (Exception $e) { - return new DataResponse($e, Http::STATUS_UNAUTHORIZED); + } catch (NotAuthorizedException $e) { + return new DataResponse($e, Http::STATUS_FORBIDDEN); + } catch (DoesNotExistException $e) { + return new DataResponse($e, Http::STATUS_OK); } } |