Skip to content

Commit

Permalink
Merge pull request #26688 from nextcloud/enh/better-share-exceptiondebug
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Oct 13, 2021
2 parents 4cae2cc + e3fa686 commit b585cf1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Share20/DefaultShareProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function create(\OCP\Share\IShare $share) {
$cursor->closeCursor();

if ($data === false) {
throw new ShareNotFound();
throw new ShareNotFound('Newly created share could not be found');
}

$mailSendValue = $share->getMailSend();
Expand Down
14 changes: 14 additions & 0 deletions lib/public/Share/Exceptions/ShareNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,18 @@
* @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);
}
}

0 comments on commit b585cf1

Please sign in to comment.