Skip to content

Commit

Permalink
Merge pull request #32751 from nextcloud/backport/32744/stable23
Browse files Browse the repository at this point in the history
[stable23] Always log errors from sending federation api requests to ease debugging
  • Loading branch information
nickvergessen authored Aug 30, 2022
2 parents 1e80b33 + 5d9f564 commit 67ec2f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
$e->getCode()
);
} catch (\Exception $e) {
$this->logger->error($e->getMessage(), ['exception' => $e]);
return new JSONResponse(
['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()],
Http::STATUS_BAD_REQUEST
Expand Down
3 changes: 2 additions & 1 deletion lib/private/Federation/CloudFederationProviderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ public function sendShare(ICloudFederationShare $share) {
return (is_array($result)) ? $result : [];
}
} catch (\Exception $e) {
$this->logger->debug($e->getMessage(), ['exception' => $e]);

// if flat re-sharing is not supported by the remote server
// we re-throw the exception and fall back to the old behaviour.
// (flat re-shares has been introduced in Nextcloud 9.1)
if ($e->getCode() === Http::STATUS_INTERNAL_SERVER_ERROR) {
$this->logger->debug($e->getMessage());
throw $e;
}
}
Expand Down

0 comments on commit 67ec2f4

Please sign in to comment.