diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-12-30 08:11:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-30 08:11:54 +0100 |
commit | 43006f2ed9cad02e80406a5c492d8736e710e6ad (patch) | |
tree | 824e32ebefc8c399db49becb793990f01347dfb0 /apps | |
parent | 7082cbc127dd42d2a2046ff9b75af6caf75dc94e (diff) | |
parent | 541a2a223444bcdcd913ba3e224adbbe5f09f408 (diff) | |
download | nextcloud-server-43006f2ed9cad02e80406a5c492d8736e710e6ad.tar.gz nextcloud-server-43006f2ed9cad02e80406a5c492d8736e710e6ad.zip |
Merge pull request #30442 from nextcloud/backport/30353/stable21
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/External/Storage.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php index 339770c8601..b4c05c45ad8 100644 --- a/apps/files_sharing/lib/External/Storage.php +++ b/apps/files_sharing/lib/External/Storage.php @@ -45,6 +45,7 @@ use OCP\Files\NotFoundException; use OCP\Files\Storage\IDisableEncryptionStorage; use OCP\Files\StorageInvalidException; use OCP\Files\StorageNotAvailableException; +use OCP\Http\Client\LocalServerException; class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage { /** @var ICloudId */ @@ -315,9 +316,16 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage { $token = $this->getToken(); $password = $this->getPassword(); - // If remote is not an ownCloud do not try to get any share info - if (!$this->remoteIsOwnCloud()) { - return ['status' => 'unsupported']; + try { + // If remote is not an ownCloud do not try to get any share info + if (!$this->remoteIsOwnCloud()) { + return ['status' => 'unsupported']; + } + } catch (LocalServerException $e) { + // throw this to be on the safe side: the share will still be visible + // in the UI in case the failure is intermittent, and the user will + // be able to decide whether to remove it if it's really gone + throw new StorageNotAvailableException(); } $url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token; |