mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +03:00
Enable room version 6 (#1087)
* Return bad request on CS API /send if bad JSON * Return some more M_BAD_JSON in the right places * nolint because damnit gocyclo all I added was a type check for an error * Update gomatrixserverlib * Update gomatrixserverlib * Update sytest-whitelist * Update gomatrixserverlib * Update sytest-whitelist * NotJSON -> BadJSON
This commit is contained in:
parent
e21d7d4baf
commit
8a6152ca70
8 changed files with 56 additions and 7 deletions
|
@ -276,7 +276,13 @@ func checkAndProcessThreepid(
|
|||
Code: http.StatusNotFound,
|
||||
JSON: jsonerror.NotFound(err.Error()),
|
||||
}
|
||||
} else if err != nil {
|
||||
} else if e, ok := err.(gomatrixserverlib.BadJSONError); ok {
|
||||
return inviteStored, &util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.BadJSON(e.Error()),
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
util.GetLogger(req.Context()).WithError(err).Error("threepid.CheckAndProcessInvite failed")
|
||||
er := jsonerror.InternalServerError()
|
||||
return inviteStored, &er
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue