aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/Swift.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/ObjectStore/Swift.php')
-rw-r--r--lib/private/Files/ObjectStore/Swift.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php
index f9c53fd333f..e07903a00bc 100644
--- a/lib/private/Files/ObjectStore/Swift.php
+++ b/lib/private/Files/ObjectStore/Swift.php
@@ -26,6 +26,7 @@
namespace OC\Files\ObjectStore;
use Guzzle\Http\Exception\ClientErrorResponseException;
+use Guzzle\Http\Exception\CurlException;
use Icewind\Streams\RetryWrapper;
use OCP\Files\ObjectStore\IObjectStore;
use OCP\Files\StorageAuthException;
@@ -157,6 +158,13 @@ class Swift implements IObjectStore {
} else {
throw $ex;
}
+ } catch (CurlException $e) {
+ if ($e->getErrorNo() === 7) {
+ $host = $e->getCurlHandle()->getUrl()->getHost() . ':' . $e->getCurlHandle()->getUrl()->getPort();
+ \OC::$server->getLogger()->error("Can't connect to object storage server at $host");
+ throw new StorageNotAvailableException("Can't connect to object storage server at $host", StorageNotAvailableException::STATUS_ERROR, $e);
+ }
+ throw $e;
}
}
@@ -180,7 +188,7 @@ class Swift implements IObjectStore {
$itemClass = new \stdClass();
$itemClass->name = $item['name'];
$itemClass->endpoints = array_map(function (array $endpoint) {
- return (object) $endpoint;
+ return (object)$endpoint;
}, $item['endpoints']);
$itemClass->type = $item['type'];