summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage/DAV.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Storage/DAV.php')
-rw-r--r--lib/private/Files/Storage/DAV.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index f9c6175308c..b5537b65747 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -35,7 +35,8 @@ namespace OC\Files\Storage;
use Exception;
use GuzzleHttp\Exception\RequestException;
-use GuzzleHttp\Message\ResponseInterface;
+use OCP\ILogger;
+use Psr\Http\Message\ResponseInterface;
use Icewind\Streams\CallbackWrapper;
use OC\Files\Filesystem;
use Icewind\Streams\IteratorDirectory;
@@ -205,7 +206,7 @@ class DAV extends Common {
try {
$response = $this->client->propFind(
$this->encodePath($path),
- ['{DAV:}href'],
+ ['{DAV:}getetag'],
1
);
if ($response === false) {
@@ -344,7 +345,7 @@ class DAV extends Common {
'auth' => [$this->user, $this->password],
'stream' => true
]);
- } catch (RequestException $e) {
+ } catch (\GuzzleHttp\Exception\ClientException $e) {
if ($e->getResponse() instanceof ResponseInterface
&& $e->getResponse()->getStatusCode() === 404) {
return false;
@@ -357,7 +358,7 @@ class DAV extends Common {
if ($response->getStatusCode() === Http::STATUS_LOCKED) {
throw new \OCP\Lock\LockedException($path);
} else {
- Util::writeLog("webdav client", 'Guzzle get returned status code ' . $response->getStatusCode(), Util::ERROR);
+ Util::writeLog("webdav client", 'Guzzle get returned status code ' . $response->getStatusCode(), ILogger::ERROR);
}
}
@@ -770,7 +771,7 @@ class DAV extends Common {
if ($response === false) {
if ($path === '') {
// if root is gone it means the storage is not available
- throw new StorageNotAvailableException(get_class($e) . ': ' . $e->getMessage());
+ throw new StorageNotAvailableException('root is gone');
}
return false;
}