mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-16 06:51:46 +01:00
Add correct M_BAD_JSON error code to /profile/{userId}/displayname (#8517)
Fixes #8029
This commit is contained in:
parent
629a951b49
commit
ec606ea9e3
2 changed files with 4 additions and 1 deletions
1
changelog.d/8517.bugfix
Normal file
1
changelog.d/8517.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix error code for `/profile/{userId}/displayname` to be `M_BAD_JSON`.
|
|
@ -59,7 +59,9 @@ class ProfileDisplaynameRestServlet(RestServlet):
|
|||
try:
|
||||
new_name = content["displayname"]
|
||||
except Exception:
|
||||
return 400, "Unable to parse name"
|
||||
raise SynapseError(
|
||||
code=400, msg="Unable to parse name", errcode=Codes.BAD_JSON,
|
||||
)
|
||||
|
||||
await self.profile_handler.set_displayname(user, requester, new_name, is_admin)
|
||||
|
||||
|
|
Loading…
Reference in a new issue