summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel <faust64@gmail.com>2021-02-05 12:06:35 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-03-30 19:26:13 +0000
commit2703777014c44093f9d962f4dbae183dc60f2322 (patch)
treee7e316dfc58ea252f3b19362cb6b0ece2f474821
parent99e2e5f6b9c90397caad27dc9e54cc0c9af28c2c (diff)
downloadnextcloud-server-2703777014c44093f9d962f4dbae183dc60f2322.tar.gz
nextcloud-server-2703777014c44093f9d962f4dbae183dc60f2322.zip
fix(translation): replace static error message
as suggested by @kesselb in nextcloud/server#25490 Signed-off-by: Samuel <faust64@gmail.com>
-rw-r--r--lib/private/Share20/Manager.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index bcdd4d2e467..7e194880e3e 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);
}
}