as suggested by @kesselb in nextcloud/server#25490
Signed-off-by: Samuel <faust64@gmail.com>
* 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
$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);
}
}