diff options
author | Erik Johnston <erik@matrix.org> | 2019-01-09 11:38:13 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-01-09 11:38:13 +0000 |
commit | 484867d35dfc99314053c58020a562d29b68da68 (patch) | |
tree | b3075131453083b31b54a0eae8022a81065ca6df /synapse/http/matrixfederationclient.py | |
parent | clean up changelog (diff) | |
parent | Merge pull request #4362 from matrix-org/erikj/better_errors (diff) | |
download | synapse-484867d35dfc99314053c58020a562d29b68da68.tar.xz |
Merge branch 'develop' into release-v0.34.1
Diffstat (limited to 'synapse/http/matrixfederationclient.py')
-rw-r--r-- | synapse/http/matrixfederationclient.py | 10 |
1 files changed, 5 insertions, 5 deletions
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): |