No need to log guzzle exception

When getting/requesting a shared secret there is no need to log the full
exception when an unexpected status code is returned since this won't
really tell us anything as the bad stuff happened on a remote server

Fixes #3380

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/4418/head
Roeland Jago Douma 8 years ago
parent e9b00f84b8
commit bec4b468c3
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 2
      apps/federation/lib/BackgroundJob/GetSharedSecret.php
  2. 2
      apps/federation/lib/BackgroundJob/RequestSharedSecret.php

@ -179,7 +179,7 @@ class GetSharedSecret extends Job{
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']);
$this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']);
}
} catch (\Exception $e) {
$status = Http::STATUS_INTERNAL_SERVER_ERROR;

@ -177,7 +177,7 @@ class RequestSharedSecret extends Job {
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']);
$this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']);
}
} catch (\Exception $e) {
$status = Http::STATUS_INTERNAL_SERVER_ERROR;

Loading…
Cancel
Save