mirror of
https://github.com/element-hq/synapse
synced 2024-08-20 13:10:20 +00:00
Merge remote-tracking branch 'origin/develop' into dbkr/send_inviter_member_event
This commit is contained in:
commit
413e36b17a
1 changed files with 4 additions and 2 deletions
|
@ -404,10 +404,12 @@ def _parse_json(request):
|
|||
try:
|
||||
content = json.loads(request.content.read())
|
||||
if type(content) != dict:
|
||||
raise SynapseError(400, "Content must be a JSON object.")
|
||||
raise SynapseError(
|
||||
400, "Content must be a JSON object.", errcode=Codes.BAD_JSON
|
||||
)
|
||||
return content
|
||||
except ValueError:
|
||||
raise SynapseError(400, "Content not JSON.")
|
||||
raise SynapseError(400, "Content not JSON.", errcode=Codes.NOT_JSON)
|
||||
|
||||
|
||||
def register_servlets(hs, http_server):
|
||||
|
|
Loading…
Reference in a new issue