Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-02-08 00:06:07 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2018-02-08 17:18:26 +0300
commite34c20af7dcbd077a3ed028f75deea302cf7ecfd (patch)
tree69410e92233e0f823ca5c7fa0a5cae6d74b6bda5 /lib
parent85d23dd6fcefe0acf07b152c9ae57824e02e0429 (diff)
don't swallow exception from touch
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php2
-rw-r--r--lib/private/Files/ObjectStore/Swift.php10
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index 094a2915730..45c22a81a7b 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -369,7 +369,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
'app' => 'objectstore',
'message' => 'Could not create object for ' . $path,
]);
- return false;
+ throw $ex;
}
}
return true;
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'];