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.
This commit is contained in:
Vincent Petry 2015-07-13 18:28:53 +02:00
parent e18d0e26f6
commit f62d94c4ff
1 changed files with 5 additions and 1 deletions

View File

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