Skip to content

Commit

Permalink
fix: catch all errors when getting rich workspace content
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
icewind1991 authored and ChristophWurst committed Aug 21, 2024
1 parent 97e6fa2 commit aadec5e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/DAV/WorkspacePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace OCA\Text\DAV;

use Exception;
use OC\Files\Node\File;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Files\FilesHome;
Expand All @@ -20,6 +21,7 @@
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\Lock\LockedException;
use Psr\Log\LoggerInterface;
use Sabre\DAV\INode;
use Sabre\DAV\PropFind;
use Sabre\DAV\Server;
Expand All @@ -37,6 +39,7 @@ public function __construct(
private IRootFolder $rootFolder,
private ICacheFactory $cacheFactory,
private IConfig $config,
private LoggerInterface $logger,
private ?string $userId
) {
}
Expand Down Expand Up @@ -96,7 +99,12 @@ public function propFind(PropFind $propFind, INode $node) {
try {
$cachedContent = $file->getContent();
$cache->set($cacheKey, $cachedContent, 3600);
} catch (GenericFileException|NotPermittedException|LockedException $e) {
} catch (GenericFileException|NotPermittedException|LockedException) {
// Ignore
} catch (Exception $e) {
$this->logger->error($e->getMessage(), [
'exception' => $e,
]);
}
}
return $cachedContent;
Expand Down

0 comments on commit aadec5e

Please sign in to comment.