Skip to content
Snippets Groups Projects
Commit b51b5b64 authored by Vincent Petry's avatar Vincent Petry
Browse files

Fix converting Guzzle error codes in s2s storage

parent 73afca62
No related branches found
No related tags found
No related merge requests found
......@@ -248,9 +248,10 @@ class Storage extends DAV implements ISharedStorage {
// TODO: DI
$client = \OC::$server->getHTTPClientService()->newClient();
try {
$response = $client->post($url, ['body' => ['password' => $password]]);
switch ($response->getStatusCode()) {
} catch (\GuzzleHttp\Exception\RequestException $e) {
switch ($e->getCode()) {
case 401:
case 403:
throw new ForbiddenException();
......@@ -259,6 +260,8 @@ class Storage extends DAV implements ISharedStorage {
case 500:
throw new \Exception();
}
throw $e;
}
return json_decode($response->getBody(), true);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment