Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-06-14 13:15:00 +0300
committerdartcafe <github@dartcafe.de>2020-06-14 13:15:00 +0300
commitc6d2e376387755e10d6c4bf4107a14e65a3a5886 (patch)
tree65cae4bd1605224c4cc080132ada21b828ced1df /lib/Controller/CommentController.php
parent734c217253323caa202e257b5187736ec28419ec (diff)
comment changed error handling
Diffstat (limited to 'lib/Controller/CommentController.php')
-rw-r--r--lib/Controller/CommentController.php6
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);
}
}