Merge pull request #32744 from nextcloud/bugfix/noid/easier-federation-debugging

Always log errors from sending federation api requests to ease debugging
pull/31981/head
Joas Schilling 4 years ago committed by GitHub
commit 9a8c9e5cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
  2. 3
      lib/private/Federation/CloudFederationProviderManager.php

@ -199,6 +199,7 @@ class RequestHandlerController extends Controller {
$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

@ -150,11 +150,12 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
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(), ['exception' => $e]);
throw $e;
}
}

Loading…
Cancel
Save