Minor visual tweaking and filemanager backend improvements.

This commit is contained in:
Dane Everitt 2017-05-05 23:13:42 -04:00
parent ee309b095e
commit de0b9beacb
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
10 changed files with 47 additions and 17 deletions

View file

@ -144,12 +144,21 @@ class FileRepository
throw new Exception('A valid directory must be specified in order to list its contents.');
}
$res = $this->server->guzzleClient()->request('GET', '/server/directory/' . rawurlencode($directory));
try {
$res = $this->server->guzzleClient()->request('GET', '/server/directory/' . rawurlencode($directory));
} catch(\GuzzleHttp\Exception\ClientException $ex) {
$json = json_decode($ex->getResponse()->getBody());
throw new DisplayException($json->error);
} catch (\GuzzleHttp\Exception\ServerException $ex) {
throw new DisplayException('A remote server error was encountered while attempting to display this directory.');
} catch (\GuzzleHttp\Exception\ConnectException $ex) {
throw new DisplayException('A ConnectException was encountered: unable to contact daemon.');
} catch (\Exception $ex) {
throw $ex;
}
$json = json_decode($res->getBody());
if ($res->getStatusCode() !== 200) {
throw new DisplayException('An error occured while attempting to save this file. ' . $res->getBody());
}
// Iterate through results
$files = [];