summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/federatedfilesharing/lib')
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index 270bf86daf7..6481abe32e2 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -222,6 +222,8 @@ class FederatedShareProvider implements IShareProvider {
$token
);
+ $failure = false;
+
try {
$sharedByFederatedId = $share->getSharedBy();
if ($this->userManager->userExists($sharedByFederatedId)) {
@@ -239,17 +241,22 @@ class FederatedShareProvider implements IShareProvider {
);
if ($send === false) {
- $message_t = $this->l->t('Sharing %s failed, could not find %s, maybe the server is currently unreachable.',
- [$share->getNode()->getName(), $share->getSharedWith()]);
- throw new \Exception($message_t);
+ $failure = true;
}
} catch (\Exception $e) {
$this->logger->error('Failed to notify remote server of federated share, removing share (' . $e->getMessage() . ')');
+ $failure = true;
+ }
+
+ if($failure) {
$this->removeShareFromTableById($shareId);
- throw $e;
+ $message_t = $this->l->t('Sharing %s failed, could not find %s, maybe the server is currently unreachable or uses a self-signed certificate.',
+ [$share->getNode()->getName(), $share->getSharedWith()]);
+ throw new \Exception($message_t);
}
return $shareId;
+
}
/**