Skip to content

Commit

Permalink
Merge pull request #26115 from nextcloud/enh/noid/log-share-exceptions
Browse files Browse the repository at this point in the history
Log exceptions when creating share
  • Loading branch information
kesselb authored Mar 15, 2021
2 parents f82edda + 6997344 commit 2a55a89
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,11 @@ public function createShare(
try {
$share = $this->shareManager->createShare($share);
} catch (GenericShareException $e) {
\OC::$server->getLogger()->logException($e);
$code = $e->getCode() === 0 ? 403 : $e->getCode();
throw new OCSException($e->getHint(), $code);
} catch (\Exception $e) {
\OC::$server->getLogger()->logException($e);
throw new OCSForbiddenException($e->getMessage(), $e);
}

Expand Down

0 comments on commit 2a55a89

Please sign in to comment.