fix(translation): replace static error message

as suggested by @kesselb in nextcloud/server#25490

Signed-off-by: Samuel <faust64@gmail.com>
This commit is contained in:
Samuel 2021-02-05 12:06:35 +01:00 committed by backportbot[bot]
parent 99e2e5f6b9
commit 2703777014
1 changed files with 3 additions and 2 deletions

View File

@ -529,7 +529,7 @@ class Manager implements IManager {
* Check for pre share requirements for user shares * Check for pre share requirements for user shares
* *
* @param IShare $share * @param IShare $share
* @throws \Exception * @throws GenericShareException
*/ */
protected function userCreateChecks(IShare $share) { protected function userCreateChecks(IShare $share) {
// Check if we can share with group members only // Check if we can share with group members only
@ -542,7 +542,8 @@ class Manager implements IManager {
$this->groupManager->getUserGroupIds($sharedWith) $this->groupManager->getUserGroupIds($sharedWith)
); );
if (empty($groups)) { 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);
} }
} }