Catch Request exception in testRemoteUrl

Else the background job fails hard if the remote has for example an
invalid certificate.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-02-15 23:06:21 +01:00 committed by Backportbot
parent 53b295456d
commit cf6cbf4870
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,7 @@ namespace OCA\Files_Sharing\External;
use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use OC\Files\Storage\DAV; use OC\Files\Storage\DAV;
use OC\ForbiddenException; use OC\ForbiddenException;
use OCA\Files_Sharing\ISharedStorage; use OCA\Files_Sharing\ISharedStorage;
@ -279,6 +280,8 @@ class Storage extends DAV implements ISharedStorage {
$returnValue = false; $returnValue = false;
} catch (ClientException $e) { } catch (ClientException $e) {
$returnValue = false; $returnValue = false;
} catch (RequestException $e) {
$returnValue = false;
} }
$cache->set($url, $returnValue, 60*60*24); $cache->set($url, $returnValue, 60*60*24);