Merge pull request #26129 from nextcloud/backport/26115/stable19

[stable19] Log exceptions when creating share
This commit is contained in:
Christoph Wurst 2021-03-16 11:09:15 +01:00 committed by GitHub
commit f9c9e27e46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -593,9 +593,11 @@ class ShareAPIController extends OCSController {
try { try {
$share = $this->shareManager->createShare($share); $share = $this->shareManager->createShare($share);
} catch (GenericShareException $e) { } catch (GenericShareException $e) {
\OC::$server->getLogger()->logException($e);
$code = $e->getCode() === 0 ? 403 : $e->getCode(); $code = $e->getCode() === 0 ? 403 : $e->getCode();
throw new OCSException($e->getHint(), $code); throw new OCSException($e->getHint(), $code);
} catch (\Exception $e) { } catch (\Exception $e) {
\OC::$server->getLogger()->logException($e);
throw new OCSForbiddenException($e->getMessage(), $e); throw new OCSForbiddenException($e->getMessage(), $e);
} }