Skip to content

Commit 9a8c9e5

Browse files
Merge pull request nextcloud#32744 from nextcloud/bugfix/noid/easier-federation-debugging
Always log errors from sending federation api requests to ease debugging
2 parents c9bee7e + 1cc2796 commit 9a8c9e5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

apps/cloud_federation_api/lib/Controller/RequestHandlerController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
199199
$e->getCode()
200200
);
201201
} catch (\Exception $e) {
202+
$this->logger->error($e->getMessage(), ['exception' => $e]);
202203
return new JSONResponse(
203204
['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()],
204205
Http::STATUS_BAD_REQUEST

lib/private/Federation/CloudFederationProviderManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,12 @@ public function sendShare(ICloudFederationShare $share) {
150150
return (is_array($result)) ? $result : [];
151151
}
152152
} catch (\Exception $e) {
153+
$this->logger->debug($e->getMessage(), ['exception' => $e]);
154+
153155
// if flat re-sharing is not supported by the remote server
154156
// we re-throw the exception and fall back to the old behaviour.
155157
// (flat re-shares has been introduced in Nextcloud 9.1)
156158
if ($e->getCode() === Http::STATUS_INTERNAL_SERVER_ERROR) {
157-
$this->logger->debug($e->getMessage(), ['exception' => $e]);
158159
throw $e;
159160
}
160161
}

0 commit comments

Comments
 (0)