diff options
author | Robin Appelman <robin@icewind.nl> | 2018-02-07 22:06:07 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-02-08 15:18:26 +0100 |
commit | e34c20af7dcbd077a3ed028f75deea302cf7ecfd (patch) | |
tree | 69410e92233e0f823ca5c7fa0a5cae6d74b6bda5 | |
parent | 85d23dd6fcefe0acf07b152c9ae57824e02e0429 (diff) | |
download | nextcloud-server-e34c20af7dcbd077a3ed028f75deea302cf7ecfd.tar.gz nextcloud-server-e34c20af7dcbd077a3ed028f75deea302cf7ecfd.zip |
don't swallow exception from touch
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 2 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/Swift.php | 10 |
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']; |