Skip to content
Snippets Groups Projects
Commit 9d1d08bf authored by Björn Schießle's avatar Björn Schießle
Browse files

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

parent 835e70db
No related branches found
No related tags found
No related merge requests found
...@@ -150,10 +150,14 @@ class GetSharedSecret extends QueuedJob{ ...@@ -150,10 +150,14 @@ class GetSharedSecret extends QueuedJob{
} catch (ClientException $e) { } catch (ClientException $e) {
$status = $e->getCode(); $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) { } catch (\Exception $e) {
$status = HTTP::STATUS_INTERNAL_SERVER_ERROR; $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 // if we received a unexpected response we try again later
......
...@@ -148,10 +148,14 @@ class RequestSharedSecret extends QueuedJob { ...@@ -148,10 +148,14 @@ class RequestSharedSecret extends QueuedJob {
} catch (ClientException $e) { } catch (ClientException $e) {
$status = $e->getCode(); $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) { } catch (\Exception $e) {
$status = HTTP::STATUS_INTERNAL_SERVER_ERROR; $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 // if we received a unexpected response we try again later
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment