diff options
author | MichaIng <micha@dietpi.com> | 2021-10-14 16:08:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 16:08:10 +0300 |
commit | d2a71ca01031677bf6aaa923adf1cf8add270109 (patch) | |
tree | fab599552852154ddb74be6d22459484af8471d8 /lib | |
parent | 049241bc04504cc0ed3d0793aac2d294f1be8276 (diff) | |
parent | d578d780e460f409c4556553173db9766e840292 (diff) |
Merge pull request #29203 from nextcloud/backport/26688/stable21
[stable21] Add proper message to created share not found
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 2 | ||||
-rw-r--r-- | lib/public/Share/Exceptions/ShareNotFound.php | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 00ef7e2426b..5e08b3da768 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -223,7 +223,7 @@ class DefaultShareProvider implements IShareProvider { $cursor->closeCursor(); if ($data === false) { - throw new ShareNotFound(); + throw new ShareNotFound('Newly created share could not be found'); } $mailSendValue = $share->getMailSend(); diff --git a/lib/public/Share/Exceptions/ShareNotFound.php b/lib/public/Share/Exceptions/ShareNotFound.php index 12cdbf4fd9c..790b11be95a 100644 --- a/lib/public/Share/Exceptions/ShareNotFound.php +++ b/lib/public/Share/Exceptions/ShareNotFound.php @@ -28,4 +28,18 @@ namespace OCP\Share\Exceptions; * @since 9.0.0 */ class ShareNotFound extends GenericShareException { + + /** + * @param string $message + * @param string $hint + * @param int $code + * @param \Exception|null $previous + * @since 9.0.0 + */ + public function __construct($message = '', ...$arguments) { + if (empty($message)) { + $message = 'Share not found'; + } + parent::__construct($message, ...$arguments); + } } |