Skip to content

Commit 3949662

Browse files
icewind1991juliusknorr
authored andcommitted
fix: catch all errors when getting rich workspace content
Signed-off-by: Robin Appelman <robin@icewind.nl> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent c9047f9 commit 3949662

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

lib/DAV/WorkspacePlugin.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
namespace OCA\Text\DAV;
2727

28+
use Exception;
2829
use OC\Files\Node\File;
2930
use OC\Files\Node\Folder;
3031
use OCA\DAV\Connector\Sabre\Directory;
@@ -37,6 +38,7 @@
3738
use OCP\Files\StorageNotAvailableException;
3839
use OCP\IConfig;
3940
use OCP\Lock\LockedException;
41+
use Psr\Log\LoggerInterface;
4042
use Sabre\DAV\INode;
4143
use Sabre\DAV\PropFind;
4244
use Sabre\DAV\Server;
@@ -55,16 +57,20 @@ class WorkspacePlugin extends ServerPlugin {
5557
/** @var IRootFolder */
5658
private $rootFolder;
5759

60+
/** @var LoggerInterface */
61+
private $logger;
62+
5863
/** @var IConfig */
5964
private $config;
6065

6166
/** @var string|null */
6267
private $userId;
6368

64-
public function __construct(WorkspaceService $workspaceService, IRootFolder $rootFolder, IConfig $config, $userId) {
69+
public function __construct(WorkspaceService $workspaceService, IRootFolder $rootFolder, IConfig $config, LoggerInterface $logger, $userId) {
6570
$this->workspaceService = $workspaceService;
6671
$this->rootFolder = $rootFolder;
6772
$this->config = $config;
73+
$this->logger = $logger;
6874
$this->userId = $userId;
6975
}
7076

@@ -123,6 +129,10 @@ public function propFind(PropFind $propFind, INode $node) {
123129
return $file->getContent();
124130
}
125131
} catch (GenericFileException|NotPermittedException|LockedException) {
132+
} catch (Exception $e) {
133+
$this->logger->error($e->getMessage(), [
134+
'exception' => $e,
135+
]);
126136
}
127137

128138
return '';

0 commit comments

Comments
 (0)