mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-05 15:42:46 +00:00
Move json errors over to gmsl (#3080)
This commit is contained in:
parent
a49c9f01e2
commit
0489d16f95
109 changed files with 808 additions and 1217 deletions
|
@ -16,10 +16,10 @@ import (
|
|||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/dendrite/roomserver/types"
|
||||
"github.com/matrix-org/gomatrixserverlib/fclient"
|
||||
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||
"github.com/matrix-org/util"
|
||||
)
|
||||
|
||||
|
@ -42,7 +42,7 @@ func GetMissingEvents(
|
|||
if err := json.Unmarshal(request.Content(), &gme); err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.NotJSON("The request body could not be decoded into valid JSON. " + err.Error()),
|
||||
JSON: spec.NotJSON("The request body could not be decoded into valid JSON. " + err.Error()),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ func GetMissingEvents(
|
|||
&eventsResponse,
|
||||
); err != nil {
|
||||
util.GetLogger(httpReq.Context()).WithError(err).Error("query.QueryMissingEvents failed")
|
||||
return jsonerror.InternalServerError()
|
||||
return spec.InternalServerError()
|
||||
}
|
||||
|
||||
eventsResponse.Events = filterEvents(eventsResponse.Events, roomID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue