diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2016-02-15 17:33:06 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2016-02-15 18:03:10 +0100 |
commit | 9d1d08bf9b0c6f7107e259594d84cb0c7496bebc (patch) | |
tree | a292bdc3780a726a24d456621ac7f69105441bc3 /apps/federation | |
parent | 835e70dbe2d68e8263affe8aa538f8b5cba25c5f (diff) | |
download | nextcloud-server-9d1d08bf9b0c6f7107e259594d84cb0c7496bebc.tar.gz nextcloud-server-9d1d08bf9b0c6f7107e259594d84cb0c7496bebc.zip |
forbidden (403) is a valid return status, don't log the whole exception in this case
Diffstat (limited to 'apps/federation')
-rw-r--r-- | apps/federation/backgroundjob/getsharedsecret.php | 8 | ||||
-rw-r--r-- | apps/federation/backgroundjob/requestsharedsecret.php | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/apps/federation/backgroundjob/getsharedsecret.php b/apps/federation/backgroundjob/getsharedsecret.php index a98a17e323b..ebc106ba94e 100644 --- a/apps/federation/backgroundjob/getsharedsecret.php +++ b/apps/federation/backgroundjob/getsharedsecret.php @@ -150,10 +150,14 @@ class GetSharedSecret extends QueuedJob{ } catch (ClientException $e) { $status = $e->getCode(); - $this->logger->logException($e); + if ($status === Http::STATUS_FORBIDDEN) { + $this->logger->info($target . ' refused to exchange a shared secret with you.', ['app' => 'federation']); + } else { + $this->logger->logException($e, ['app' => 'federation']); + } } catch (\Exception $e) { $status = HTTP::STATUS_INTERNAL_SERVER_ERROR; - $this->logger->logException($e); + $this->logger->logException($e, ['app' => 'federation']); } // if we received a unexpected response we try again later diff --git a/apps/federation/backgroundjob/requestsharedsecret.php b/apps/federation/backgroundjob/requestsharedsecret.php index 2db5d09545a..302711af27f 100644 --- a/apps/federation/backgroundjob/requestsharedsecret.php +++ b/apps/federation/backgroundjob/requestsharedsecret.php @@ -148,10 +148,14 @@ class RequestSharedSecret extends QueuedJob { } catch (ClientException $e) { $status = $e->getCode(); - $this->logger->logException($e); + if ($status === Http::STATUS_FORBIDDEN) { + $this->logger->info($target . ' refused to ask for a shared secret.', ['app' => 'federation']); + } else { + $this->logger->logException($e, ['app' => 'federation']); + } } catch (\Exception $e) { $status = HTTP::STATUS_INTERNAL_SERVER_ERROR; - $this->logger->logException($e); + $this->logger->logException($e, ['app' => 'federation']); } // if we received a unexpected response we try again later |