From 2703777014c44093f9d962f4dbae183dc60f2322 Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 5 Feb 2021 12:06:35 +0100 Subject: [PATCH] fix(translation): replace static error message as suggested by @kesselb in nextcloud/server#25490 Signed-off-by: Samuel --- lib/private/Share20/Manager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index bcdd4d2e46..7e194880e3 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -529,7 +529,7 @@ class Manager implements IManager { * Check for pre share requirements for user shares * * @param IShare $share - * @throws \Exception + * @throws GenericShareException */ protected function userCreateChecks(IShare $share) { // Check if we can share with group members only @@ -542,7 +542,8 @@ class Manager implements IManager { $this->groupManager->getUserGroupIds($sharedWith) ); if (empty($groups)) { - throw new \Exception('Sharing is only allowed with group members'); + $message_t = $this->l->t('Sharing is only allowed with group members'); + throw new GenericShareException($message_t, $message_t, 404); } }