Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-03-15 14:00:41 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-03-15 18:06:43 +0300
commit20ebdf4fe040d1fd9ce3629e90f9132abd1881ba (patch)
treefcc6059e1a60029396b8bded130dbfbf5b00c3d8 /apps/files_sharing/lib/Controller/ShareAPIController.php
parent3e18eca7a01cdc91013aab8e6296274dbdd556f5 (diff)
Log exceptions when creating share
Because the exceptions don't always contain a useful message for the UI, but also because in some cases we need to find out what went wrong. In some setups, a ShareNotFoundException might happen during creation when we try to re-read the just written share. Usually related to Galera Cluster where node syncing wait is not enabled. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/lib/Controller/ShareAPIController.php')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 2a2e2614811..f3b107c6de5 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -616,9 +616,11 @@ class ShareAPIController extends OCSController {
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);
}