aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-11-08 17:09:41 +0100
committerGitHub <noreply@github.com>2024-11-08 17:09:41 +0100
commit4e818128ef691e2d1d88b1b9a357637301efdfc9 (patch)
tree85e19293af8d867082bceb7f393ba88caa7c7586
parentc87060816df3a25e0812410665f224b6c82e46a1 (diff)
parent954b6c68a062897986f16d0faa2e4f7f832149b7 (diff)
downloadnextcloud-server-4e818128ef691e2d1d88b1b9a357637301efdfc9.tar.gz
nextcloud-server-4e818128ef691e2d1d88b1b9a357637301efdfc9.zip
Merge pull request #49146 from nextcloud/fix/undefined-response
-rw-r--r--lib/private/Files/Storage/DAV.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index b849a69246f..10670d6331a 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -250,6 +250,7 @@ class DAV extends Common {
// we either don't know it, or we know it exists but need more details
if (is_null($cachedResponse) || $cachedResponse === true) {
$this->init();
+ $response = false;
try {
$response = $this->client->propFind(
$this->encodePath($path),
@@ -260,9 +261,9 @@ class DAV extends Common {
if ($e->getHttpStatus() === 404 || $e->getHttpStatus() === 405) {
$this->statCache->clear($path . '/');
$this->statCache->set($path, false);
- return false;
+ } else {
+ $this->convertException($e, $path);
}
- $this->convertException($e, $path);
} catch (\Exception $e) {
$this->convertException($e, $path);
}
@@ -345,7 +346,7 @@ class DAV extends Common {
if ($response->getStatusCode() === Http::STATUS_LOCKED) {
throw new \OCP\Lock\LockedException($path);
} else {
- Server::get(LoggerInterface::class)->error('Guzzle get returned status code ' . $response->getStatusCode(), ['app' => 'webdav client']);
+ $this->logger->error('Guzzle get returned status code ' . $response->getStatusCode(), ['app' => 'webdav client']);
}
}
@@ -772,7 +773,7 @@ class DAV extends Common {
* @throws ForbiddenException if the action is not allowed
*/
protected function convertException(Exception $e, string $path = ''): void {
- Server::get(LoggerInterface::class)->debug($e->getMessage(), ['app' => 'files_external', 'exception' => $e]);
+ $this->logger->debug($e->getMessage(), ['app' => 'files_external', 'exception' => $e]);
if ($e instanceof ClientHttpException) {
if ($e->getHttpStatus() === Http::STATUS_LOCKED) {
throw new \OCP\Lock\LockedException($path);