mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 13:22:26 +03: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
|
@ -18,7 +18,6 @@ import (
|
|||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||
"github.com/matrix-org/dendrite/relayapi/api"
|
||||
"github.com/matrix-org/gomatrixserverlib/fclient"
|
||||
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||
|
@ -40,13 +39,13 @@ func GetTransactionFromRelay(
|
|||
if err := json.Unmarshal(fedReq.Content(), &previousEntry); err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
JSON: jsonerror.BadJSON("invalid json provided"),
|
||||
JSON: spec.BadJSON("invalid json provided"),
|
||||
}
|
||||
}
|
||||
if previousEntry.EntryID < 0 {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
JSON: jsonerror.BadJSON("Invalid entry id provided. Must be >= 0."),
|
||||
JSON: spec.BadJSON("Invalid entry id provided. Must be >= 0."),
|
||||
}
|
||||
}
|
||||
logrus.Infof("Previous entry provided: %v", previousEntry.EntryID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue