Remove SynapseError substitutions

pull/8719/head
Andrew Morgan 2020-11-10 12:11:08 +00:00
parent 64b1d36436
commit 02b703c7d8
1 changed files with 2 additions and 3 deletions

View File

@ -1064,7 +1064,7 @@ def check_content_type_is_json(headers):
c_type = headers.getRawHeaders(b"Content-Type") c_type = headers.getRawHeaders(b"Content-Type")
if c_type is None: if c_type is None:
raise RequestSendFailed( raise RequestSendFailed(
SynapseError(502, "No Content-Type header received from remote server"), RuntimeError("No Content-Type header received from remote server"),
can_retry=False, can_retry=False,
) )
@ -1072,8 +1072,7 @@ def check_content_type_is_json(headers):
val, options = cgi.parse_header(c_type) val, options = cgi.parse_header(c_type)
if val != "application/json": if val != "application/json":
raise RequestSendFailed( raise RequestSendFailed(
SynapseError( RuntimeError(
502,
"Remote server sent Content-Type header of '%s', not 'application/json'" "Remote server sent Content-Type header of '%s', not 'application/json'"
% c_type, % c_type,
), ),