Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-12-30 10:10:57 +0300
committerGitHub <noreply@github.com>2021-12-30 10:10:57 +0300
commit6c051b242b6ccbb8fea80d0989f6ff4f67dc673c (patch)
tree6441e045effb3a44195c597139a090523f6b24be /apps
parentaaef453ac72aac8d7fde0abced9dceb532978688 (diff)
parent8cb63f32838780bd253cecbc5619e43ab83ae661 (diff)
Merge pull request #30444 from nextcloud/backport/30353/stable22
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/External/Storage.php14
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 7d9e8f31c98..67df60cb55f 100644
--- a/apps/files_sharing/lib/External/Storage.php
+++ b/apps/files_sharing/lib/External/Storage.php
@@ -44,6 +44,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 */
@@ -314,9 +315,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;