]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(translation): replace static error message
authorSamuel <faust64@gmail.com>
Fri, 5 Feb 2021 11:06:35 +0000 (12:06 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 30 Mar 2021 19:26:04 +0000 (19:26 +0000)
as suggested by @kesselb in nextcloud/server#25490

Signed-off-by: Samuel <faust64@gmail.com>
lib/private/Share20/Manager.php

index f58bf8825547a37b1787de3217692108d25b46c7..b021cedbcb0c28581632b9cea95546fe8df7e980 100644 (file)
@@ -530,7 +530,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
@@ -543,7 +543,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);
                        }
                }