summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Share20/DefaultShareProvider.php2
-rw-r--r--lib/public/Share/Exceptions/ShareNotFound.php14
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index 96958a32a63..85655c4e379 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -222,7 +222,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 6e4dd2677ae..66827b4d179 100644
--- a/lib/public/Share/Exceptions/ShareNotFound.php
+++ b/lib/public/Share/Exceptions/ShareNotFound.php
@@ -27,4 +27,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);
+ }
}