Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Feb 26, 2016

Conversation

Projects
None yet
3 participants

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

Add error codes for malformed/bad JSON in /login
Signed-off-by: Gergely Polonkai <gergely@polonkaieu>

Can one of the admins verify this patch?

Member

dbkr commented Feb 26, 2016

matrixbot: ok to test

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
)

There you go, PEP8 dragon.

dbkr added a commit that referenced this pull request Feb 26, 2016

Merge pull request #608 from gergelypolonkai/syn-638
Add error codes for malformed/bad JSON in /login

@dbkr dbkr merged commit 9329cd5 into matrix-org:develop Feb 26, 2016

1 check passed

default Build finished. 367 tests run, 0 skipped, 0 failed.
Details

@gergelypolonkai gergelypolonkai deleted the gergelypolonkai:syn-638 branch Mar 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment