forbidden (403) is a valid return status, don't log the whole exception in this case

This commit is contained in:
Bjoern Schiessle 2016-02-15 17:33:06 +01:00
parent 835e70dbe2
commit 9d1d08bf9b
2 changed files with 12 additions and 4 deletions

View File

@ -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

View File

@ -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