From 88ef163276fc030006a061358f42746b59c489f3 Mon Sep 17 00:00:00 2001
From: Robin Appelman <robin@icewind.nl>
Date: Mon, 27 Jun 2016 21:34:28 +0200
Subject: handle unavailable fed shares while testing for availability (#25277)

* More explicit http status codes

* handle unavailable fed shares while testing for availability
---
 lib/private/Files/Storage/DAV.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'lib/private/Files/Storage')

diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index 0d41b3bab02..c8088a41c47 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -814,13 +814,13 @@ class DAV extends Common {
 	private function convertException(Exception $e, $path = '') {
 		Util::writeLog('files_external', $e->getMessage(), Util::ERROR);
 		if ($e instanceof ClientHttpException) {
-			if ($e->getHttpStatus() === 423) {
+			if ($e->getHttpStatus() === Http::STATUS_LOCKED) {
 				throw new \OCP\Lock\LockedException($path);
 			}
-			if ($e->getHttpStatus() === 401) {
+			if ($e->getHttpStatus() === Http::STATUS_UNAUTHORIZED) {
 				// either password was changed or was invalid all along
 				throw new StorageInvalidException(get_class($e) . ': ' . $e->getMessage());
-			} else if ($e->getHttpStatus() === 405) {
+			} else if ($e->getHttpStatus() === Http::STATUS_METHOD_NOT_ALLOWED) {
 				// ignore exception for MethodNotAllowed, false will be returned
 				return;
 			}
-- 
cgit v1.2.3