Skip to content

Commit

Permalink
Merge pull request #6243 from nextcloud/dav-workspace-catch-more
Browse files Browse the repository at this point in the history
fix: catch all errors when getting rich workspace content
  • Loading branch information
juliusknorr authored Aug 22, 2024
2 parents 97e6fa2 + aadec5e commit 6e7b347
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 6e7b347

Please sign in to comment.