diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-11-19 11:17:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 11:17:30 +0100 |
commit | 6559c2075e46c796ff518b0e23e38534783ed194 (patch) | |
tree | 4db6e62bc3551bdc9c6a2d6b65b56fb1856ca0c9 /apps | |
parent | 47322e8b9e8b440a95cb1921a710561e2206ee5a (diff) | |
parent | f44a192613e6d97c1b48f6697ecb4d8f5b8ab0b9 (diff) | |
download | nextcloud-server-6559c2075e46c796ff518b0e23e38534783ed194.tar.gz nextcloud-server-6559c2075e46c796ff518b0e23e38534783ed194.zip |
Merge pull request #49361 from nextcloud/fix/fix-share-creation-error-messages
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 71f73f777a5..99242761b29 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -37,6 +37,7 @@ use OCP\Files\InvalidPathException; use OCP\Files\IRootFolder; use OCP\Files\Node; use OCP\Files\NotFoundException; +use OCP\HintException; use OCP\IConfig; use OCP\IDateTimeZone; use OCP\IGroupManager; @@ -49,7 +50,6 @@ use OCP\Lock\ILockingProvider; use OCP\Lock\LockedException; use OCP\Mail\IMailer; use OCP\Server; -use OCP\Share\Exceptions\GenericShareException; use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IManager; use OCP\Share\IProviderFactory; @@ -811,7 +811,7 @@ class ShareAPIController extends OCSController { try { $share = $this->shareManager->createShare($share); - } catch (GenericShareException $e) { + } catch (HintException $e) { $code = $e->getCode() === 0 ? 403 : $e->getCode(); throw new OCSException($e->getHint(), $code); } catch (\Exception $e) { @@ -1357,7 +1357,7 @@ class ShareAPIController extends OCSController { try { $share = $this->shareManager->updateShare($share); - } catch (GenericShareException $e) { + } catch (HintException $e) { $code = $e->getCode() === 0 ? 403 : $e->getCode(); throw new OCSException($e->getHint(), (int)$code); } catch (\Exception $e) { @@ -1445,7 +1445,7 @@ class ShareAPIController extends OCSController { try { $this->shareManager->acceptShare($share, $this->userId); - } catch (GenericShareException $e) { + } catch (HintException $e) { $code = $e->getCode() === 0 ? 403 : $e->getCode(); throw new OCSException($e->getHint(), (int)$code); } catch (\Exception $e) { |