Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add error codes for malformed/bad JSON in /login #608

Merged
merged 2 commits into from Feb 26, 2016

Conversation

gergelypolonkai
Copy link
Contributor

Malformed/bad JSON data caused an M_UNKNOWN to be sent for the client instead of NOT_JSON/BAD_JSON.

Signed-off-by: Gergely Polonkai <gergely@polonkaieu>
@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@dbkr
Copy link
Member

dbkr commented Feb 26, 2016

matrixbot: ok to test

@dbkr
Copy link
Member

dbkr commented Feb 26, 2016

Needs more line breaks to appease the PEP8 dragon, but otherwise lgtm.

So you'd want:

raise SynapseError(
    400, "Content must be a JSON object.", errcode=Codes.BAD_JSON
)

@gergelypolonkai
Copy link
Contributor Author

There you go, PEP8 dragon.

dbkr added a commit that referenced this pull request Feb 26, 2016
Add error codes for malformed/bad JSON in /login
@dbkr dbkr merged commit 9329cd5 into matrix-org:develop Feb 26, 2016
@gergelypolonkai gergelypolonkai deleted the syn-638 branch March 1, 2016 10:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants