aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-03-20 09:56:19 +0100
committerGitHub <noreply@github.com>2025-03-20 09:56:19 +0100
commit00465dc9410c70b3b87de9b6e3724bdb0131f446 (patch)
tree197c51be4df30191116369c8935d99fdb1c92a11
parent8d874b7fe38e78f4915d7e070612d4d8c5394507 (diff)
parente5cca48be694a239936ee24b797c02cdfd792986 (diff)
downloadnextcloud-server-00465dc9410c70b3b87de9b6e3724bdb0131f446.tar.gz
nextcloud-server-00465dc9410c70b3b87de9b6e3724bdb0131f446.zip
Merge pull request #51584 from nextcloud/backport/48793/stable30
[stable30] fix: log which file cannot be opened
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index fc3ed05d7ca..82788bfd3d2 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -449,14 +449,19 @@ class File extends Node implements IFile {
// do a if the file did not exist
throw new NotFound();
}
+ $path = ltrim($this->path, '/');
try {
- $res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
+ $res = $this->fileView->fopen($path, 'rb');
} catch (\Exception $e) {
$this->convertToSabreException($e);
}
if ($res === false) {
- throw new ServiceUnavailable($this->l10n->t('Could not open file'));
+ if ($this->fileView->file_exists($path)) {
+ throw new ServiceUnavailable($this->l10n->t('Could not open file: %1$s, file does seem to exist', [$path]));
+ } else {
+ throw new ServiceUnavailable($this->l10n->t('Could not open file: %1$s, file doesn\'t seem to exist', [$path]));
+ }
}
// comparing current file size with the one in DB