-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/ocs/v1.php/cloud/groups
UPDATE
method - correct status when group not found
#39537
Conversation
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
/ocs/v1.php/cloud/groups
UPDATE
method - correct status when group not found
@@ -271,6 +271,9 @@ public function updateGroup(string $groupId, string $key, string $value): DataRe | |||
|
|||
if ($key === 'displayname') { | |||
$group = $this->groupManager->get($groupId); | |||
if ($group === null) { | |||
throw new OCSException('Group does not exist', OCSController::RESPOND_NOT_FOUND); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new OCSException('Group does not exist', OCSController::RESPOND_NOT_FOUND); | |
throw new OCSException("Group $groupId does not exist", OCSController::RESPOND_NOT_FOUND); |
Is probably more helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the caller already knows what group he requested to edit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise looks good.
/backport to stable27 |
/backport to stable26 |
Summary
We should return
OCSController::RESPOND_NOT_FOUND
when something from input parameters not found and set text description what exactly was not found.Checklist