[Pkg-owncloud-commits] [owncloud] 40/131: Throw StorageNotAvailable if propfind on root failed

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 15:58:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.1.1
in repository owncloud.

commit 48b2a4e0343892f52ba708213fe48a1468581d36
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Mon Jul 13 18:28:53 2015 +0200

    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 d67e6b9..e02f971 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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list