mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Don't wrap errors
This commit is contained in:
parent
f3bf6eb9f2
commit
61363c00f4
|
|
@ -28,10 +28,6 @@ import (
|
||||||
"github.com/matrix-org/util"
|
"github.com/matrix-org/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JoinError struct {
|
|
||||||
Error interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MakeJoin implements the /make_join API
|
// MakeJoin implements the /make_join API
|
||||||
func MakeJoin(
|
func MakeJoin(
|
||||||
httpReq *http.Request,
|
httpReq *http.Request,
|
||||||
|
|
@ -228,9 +224,7 @@ func SendJoin(
|
||||||
if verifyResults[0].Error != nil {
|
if verifyResults[0].Error != nil {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusForbidden,
|
Code: http.StatusForbidden,
|
||||||
JSON: JoinError{
|
JSON: jsonerror.Forbidden("Signature check failed: " + verifyResults[0].Error.Error()),
|
||||||
Error: jsonerror.Forbidden("Signature check failed: " + verifyResults[0].Error.Error()),
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||||
eduserverAPI "github.com/matrix-org/dendrite/eduserver/api"
|
eduserverAPI "github.com/matrix-org/dendrite/eduserver/api"
|
||||||
federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api"
|
federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api"
|
||||||
"github.com/matrix-org/dendrite/internal/config"
|
"github.com/matrix-org/dendrite/internal/config"
|
||||||
|
|
@ -208,9 +209,9 @@ func Setup(
|
||||||
body = []interface{}{
|
body = []interface{}{
|
||||||
res.Code, res.JSON,
|
res.Code, res.JSON,
|
||||||
}
|
}
|
||||||
jerr, ok := res.JSON.(JoinError)
|
jerr, ok := res.JSON.(*jsonerror.MatrixError)
|
||||||
if ok {
|
if ok {
|
||||||
body = jerr.Error
|
body = jerr
|
||||||
}
|
}
|
||||||
|
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue