diff options
Diffstat (limited to 'clientapi/routing/membership.go')
-rw-r--r-- | clientapi/routing/membership.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go index cd0ce732..74d92a05 100644 --- a/clientapi/routing/membership.go +++ b/clientapi/routing/membership.go @@ -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 |