From 48b2a4e0343892f52ba708213fe48a1468581d36 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 13 Jul 2015 18:28:53 +0200 Subject: Throw StorageNotAvailable if propfind on root failed If PROPFIND fails with 404 or 405 on the remote share root, it means the storage is not available. Throw StorageNotAvailable is such case. --- lib/private/files/storage/dav.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php index d67e6b9f97e..e02f971b38b 100644 --- a/lib/private/files/storage/dav.php +++ b/lib/private/files/storage/dav.php @@ -760,7 +760,11 @@ class DAV extends Common { return $remoteMtime > $time; } } catch (ClientHttpException $e) { - if ($e->getHttpStatus() === 404) { + if ($e->getHttpStatus() === 404 || $e->getHttpStatus() === 405) { + if ($path === '') { + // if root is gone it means the storage is not available + throw new StorageNotAvailableException(get_class($e).': '.$e->getMessage()); + } return false; } $this->convertException($e); -- cgit v1.2.3