]> source.dussan.org Git - nextcloud-server.git/commitdiff
chore: use `$this->logger` and prevent Server::get fix/undefined-response 49146/head
authorskjnldsv <skjnldsv@protonmail.com>
Fri, 8 Nov 2024 09:42:07 +0000 (10:42 +0100)
committerskjnldsv <skjnldsv@protonmail.com>
Fri, 8 Nov 2024 09:56:30 +0000 (10:56 +0100)
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
lib/private/Files/Storage/DAV.php

index 3d3937b44b7c78c8d86f1de377a34b54e0d74116..10670d6331a0efefe44c7006bb5fa0f097e10702 100644 (file)
@@ -346,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']);
                                        }
                                }
 
@@ -773,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);