Skip to content

Commit 6e7b347

Browse files
authored
Merge pull request #6243 from nextcloud/dav-workspace-catch-more
fix: catch all errors when getting rich workspace content
2 parents 97e6fa2 + aadec5e commit 6e7b347

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lib/DAV/WorkspacePlugin.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace OCA\Text\DAV;
1010

11+
use Exception;
1112
use OC\Files\Node\File;
1213
use OCA\DAV\Connector\Sabre\Directory;
1314
use OCA\DAV\Files\FilesHome;
@@ -20,6 +21,7 @@
2021
use OCP\ICacheFactory;
2122
use OCP\IConfig;
2223
use OCP\Lock\LockedException;
24+
use Psr\Log\LoggerInterface;
2325
use Sabre\DAV\INode;
2426
use Sabre\DAV\PropFind;
2527
use Sabre\DAV\Server;
@@ -37,6 +39,7 @@ public function __construct(
3739
private IRootFolder $rootFolder,
3840
private ICacheFactory $cacheFactory,
3941
private IConfig $config,
42+
private LoggerInterface $logger,
4043
private ?string $userId
4144
) {
4245
}
@@ -96,7 +99,12 @@ public function propFind(PropFind $propFind, INode $node) {
9699
try {
97100
$cachedContent = $file->getContent();
98101
$cache->set($cacheKey, $cachedContent, 3600);
99-
} catch (GenericFileException|NotPermittedException|LockedException $e) {
102+
} catch (GenericFileException|NotPermittedException|LockedException) {
103+
// Ignore
104+
} catch (Exception $e) {
105+
$this->logger->error($e->getMessage(), [
106+
'exception' => $e,
107+
]);
100108
}
101109
}
102110
return $cachedContent;

0 commit comments

Comments
 (0)