don't swallow exception from touch

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2018-02-07 22:06:07 +01:00 committed by Roeland Jago Douma
parent 85d23dd6fc
commit e34c20af7d
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 10 additions and 2 deletions

View File

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

View File

@ -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'];