diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-03-20 09:56:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-20 09:56:19 +0100 |
commit | 00465dc9410c70b3b87de9b6e3724bdb0131f446 (patch) | |
tree | 197c51be4df30191116369c8935d99fdb1c92a11 | |
parent | 8d874b7fe38e78f4915d7e070612d4d8c5394507 (diff) | |
parent | e5cca48be694a239936ee24b797c02cdfd792986 (diff) | |
download | nextcloud-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.php | 9 |
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 |