diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index a937120e4..8dcd15333 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -28,10 +28,6 @@ import ( "github.com/matrix-org/util" ) -type JoinError struct { - Error interface{} -} - // MakeJoin implements the /make_join API func MakeJoin( httpReq *http.Request, @@ -228,9 +224,7 @@ func SendJoin( if verifyResults[0].Error != nil { return util.JSONResponse{ Code: http.StatusForbidden, - JSON: JoinError{ - Error: jsonerror.Forbidden("Signature check failed: " + verifyResults[0].Error.Error()), - }, + JSON: jsonerror.Forbidden("Signature check failed: " + verifyResults[0].Error.Error()), } } diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go index 8db3ed5ca..645f397de 100644 --- a/federationapi/routing/routing.go +++ b/federationapi/routing/routing.go @@ -18,6 +18,7 @@ import ( "net/http" "github.com/gorilla/mux" + "github.com/matrix-org/dendrite/clientapi/jsonerror" eduserverAPI "github.com/matrix-org/dendrite/eduserver/api" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" "github.com/matrix-org/dendrite/internal/config" @@ -208,9 +209,9 @@ func Setup( body = []interface{}{ res.Code, res.JSON, } - jerr, ok := res.JSON.(JoinError) + jerr, ok := res.JSON.(*jsonerror.MatrixError) if ok { - body = jerr.Error + body = jerr } return util.JSONResponse{