chore: use $this->logger and prevent Server::get

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
skjnldsv 2024-11-08 10:42:07 +01:00
parent 0f96a2ccb9
commit 954b6c68a0

View 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);