Compare commits

...

2 Commits

Author SHA1 Message Date
John Molakvoæ (skjnldsv) 3612a1097a
Default message for ShareNotFound exception
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-04-22 08:50:17 +02:00
John Molakvoæ (skjnldsv) 3d4929bd57
Add proper message to created share not found
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-04-22 08:50:17 +02:00
2 changed files with 15 additions and 1 deletions

View File

@ -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();

View File

@ -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);
}
}