mirror of
https://github.com/nextcloud/server.git
synced 2026-04-25 16:19:06 -04:00
Merge pull request #31261 from nextcloud/external-share-availability-error
This commit is contained in:
commit
a6bc871c96
1 changed files with 5 additions and 7 deletions
12
apps/files_sharing/lib/External/Storage.php
vendored
12
apps/files_sharing/lib/External/Storage.php
vendored
|
|
@ -222,22 +222,20 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage {
|
|||
// we remove the invalid storage
|
||||
$this->manager->removeShare($this->mountPoint);
|
||||
$this->manager->getMountManager()->removeMount($this->mountPoint);
|
||||
throw new StorageInvalidException();
|
||||
throw new StorageInvalidException("Remote share not found", 0, $e);
|
||||
} else {
|
||||
// Nextcloud instance is gone, likely to be a temporary server configuration error
|
||||
throw new StorageNotAvailableException();
|
||||
throw new StorageNotAvailableException("No nextcloud instance found at remote", 0, $e);
|
||||
}
|
||||
} catch (ForbiddenException $e) {
|
||||
// auth error, remove share for now (provide a dialog in the future)
|
||||
$this->manager->removeShare($this->mountPoint);
|
||||
$this->manager->getMountManager()->removeMount($this->mountPoint);
|
||||
throw new StorageInvalidException();
|
||||
throw new StorageInvalidException("Auth error when getting remote share");
|
||||
} catch (\GuzzleHttp\Exception\ConnectException $e) {
|
||||
throw new StorageNotAvailableException();
|
||||
throw new StorageNotAvailableException("Failed to connect to remote instance", 0, $e);
|
||||
} catch (\GuzzleHttp\Exception\RequestException $e) {
|
||||
throw new StorageNotAvailableException();
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
throw new StorageNotAvailableException("Error while sending request to remote instance", 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue