summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-01-09 09:13:16 +0000
committerErik Johnston <erik@matrix.org>2019-01-09 09:13:16 +0000
commit7fafa2d95493dd6b62770f54efb16b223f2eb71d (patch)
tree0e756ac6e19c0364926ed51a886d4e7e24485f11 /synapse
parentMerge tag 'v0.34.1rc1' into matrix-org-hotfixes (diff)
parentMerge pull request #4362 from matrix-org/erikj/better_errors (diff)
downloadsynapse-7fafa2d95493dd6b62770f54efb16b223f2eb71d.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse')
-rw-r--r--synapse/federation/transaction_queue.py7
-rw-r--r--synapse/http/matrixfederationclient.py10
2 files changed, 11 insertions, 6 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py

index 4640513497..fe787abaeb 100644 --- a/synapse/federation/transaction_queue.py +++ b/synapse/federation/transaction_queue.py
@@ -522,8 +522,13 @@ class TransactionQueue(object): ) except FederationDeniedError as e: logger.info(e) + except HttpResponseException as e: + logger.warning( + "TX [%s] Received %d response to transaction: %s", + destination, e.code, e, + ) except RequestSendFailed as e: - logger.warning("(TX [%s] Failed to send transaction: %s", destination, e) + logger.warning("TX [%s] Failed to send transaction: %s", destination, e) for p, _ in pending_pdus: logger.info("Failed to send event %s to %s", p.event_id, diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index 7a2b4f0957..be4076fc6a 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py
@@ -823,21 +823,21 @@ def check_content_type_is_json(headers): headers (twisted.web.http_headers.Headers): headers to check Raises: - RuntimeError if the + RequestSendFailed: if the Content-Type header is missing or isn't JSON """ c_type = headers.getRawHeaders(b"Content-Type") if c_type is None: - raise RuntimeError( + raise RequestSendFailed(RuntimeError( "No Content-Type header" - ) + ), can_retry=False) c_type = c_type[0].decode('ascii') # only the first header val, options = cgi.parse_header(c_type) if val != "application/json": - raise RuntimeError( + raise RequestSendFailed(RuntimeError( "Content-Type not application/json: was '%s'" % c_type - ) + ), can_retry=False) def encode_query_args(args):