diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-18 10:29:29 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-18 10:29:29 +0000 |
commit | fe672a04f7fcaaf35769d97eb2c52017fc51664e (patch) | |
tree | 419f8533df3d91a15ad35d286f36aa719e29f39e /synapse/http/matrixfederationclient.py | |
parent | Merge pull request #79 from matrix-org/get_pdu_limiting (diff) | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into failures (diff) | |
download | synapse-fe672a04f7fcaaf35769d97eb2c52017fc51664e.tar.xz |
Merge pull request #77 from matrix-org/failures
Failures
Diffstat (limited to 'synapse/http/matrixfederationclient.py')
-rw-r--r-- | synapse/http/matrixfederationclient.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 1927948001..454c3d4ab1 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -146,14 +146,22 @@ class MatrixFederationHttpClient(object): ) raise SynapseError(400, "Domain specified not found.") + if hasattr(e, "reasons"): + reasons = ", ".join( + f.value.message + for f in e.reasons + ) + else: + reasons = e.message + logger.warn( - "Sending request failed to %s: %s %s : %s", + "Sending request failed to %s: %s %s: %s - %s", destination, method, url_bytes, - e + type(e). __name__, + reasons, ) - _print_ex(e) if retries_left: yield sleep(2 ** (5 - retries_left)) @@ -447,14 +455,6 @@ def _readBodyToFile(response, stream, max_size): return d -def _print_ex(e): - if hasattr(e, "reasons") and e.reasons: - for ex in e.reasons: - _print_ex(ex) - else: - logger.warn(e) - - class _JsonProducer(object): """ Used by the twisted http client to create the HTTP body from json """ |