mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 04:33:53 +01:00
More helpful 400 error messages.
This commit is contained in:
parent
688c37ebf4
commit
34d7896b06
1 changed files with 5 additions and 1 deletions
|
@ -82,6 +82,10 @@ class RegisterRestServlet(RestServlet):
|
||||||
|
|
||||||
session = (register_json["session"] if "session" in register_json
|
session = (register_json["session"] if "session" in register_json
|
||||||
else None)
|
else None)
|
||||||
|
login_type = None
|
||||||
|
if "type" not in register_json:
|
||||||
|
raise SynapseError(400, "Missing 'type' key.")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
login_type = register_json["type"]
|
login_type = register_json["type"]
|
||||||
stages = {
|
stages = {
|
||||||
|
@ -106,7 +110,7 @@ class RegisterRestServlet(RestServlet):
|
||||||
defer.returnValue((200, response))
|
defer.returnValue((200, response))
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
raise SynapseError(400, "Missing JSON keys or bad login type.")
|
raise SynapseError(400, "Missing JSON keys for login type %s." % login_type)
|
||||||
|
|
||||||
def on_OPTIONS(self, request):
|
def on_OPTIONS(self, request):
|
||||||
return (200, {})
|
return (200, {})
|
||||||
|
|
Loading…
Reference in a new issue