mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2024-10-01 03:35:38 -04:00
daemon: Explain the status quo with quaternion.
This commit is contained in:
parent
7ee128f185
commit
cb85544ff9
@ -89,18 +89,21 @@ class ProxyDaemon:
|
||||
try:
|
||||
body = await request.json()
|
||||
except JSONDecodeError:
|
||||
# TODO what to do here, quaternion retries the login if we raise an
|
||||
# exception here, throws an error if we send out an 400 and hangs
|
||||
# if we forward it to the router() method.
|
||||
print("JSON ERROR IN LOGIN")
|
||||
raise
|
||||
# return web.Response(
|
||||
# status=400,
|
||||
# text=json.dumps({
|
||||
# "errcode": "M_NOT_JSON",
|
||||
# "error": "Request did not contain valid JSON."
|
||||
# })
|
||||
# )
|
||||
# After a long debugging session the culprit ended up being aiohttp
|
||||
# and a similar bug to
|
||||
# https://github.com/aio-libs/aiohttp/issues/2277 but in the server
|
||||
# part of aiohttp. The bug is fixed in the latest master of
|
||||
# aiohttp.
|
||||
# Return 500 here for now since quaternion doesn't work otherwise.
|
||||
# After aiohttp 4.0 gets replace this with a 400 M_NOT_JSON
|
||||
# response.
|
||||
return web.Response(
|
||||
status=500,
|
||||
text=json.dumps({
|
||||
"errcode": "M_NOT_JSON",
|
||||
"error": "Request did not contain valid JSON."
|
||||
})
|
||||
)
|
||||
|
||||
print("Login request")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user