From e502d6b6d1826bfc56a7d7609190c4682bc9530a Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 14 Aug 2020 15:34:35 +0100 Subject: [PATCH] Linter --- federationsender/inthttp/server.go | 1 + roomserver/inthttp/server.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/federationsender/inthttp/server.go b/federationsender/inthttp/server.go index 21e57db84..f02cbd12d 100644 --- a/federationsender/inthttp/server.go +++ b/federationsender/inthttp/server.go @@ -11,6 +11,7 @@ import ( ) // AddRoutes adds the FederationSenderInternalAPI handlers to the http.ServeMux. +// nolint:gocyclo func AddRoutes(intAPI api.FederationSenderInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationSenderQueryJoinedHostServerNamesInRoomPath, diff --git a/roomserver/inthttp/server.go b/roomserver/inthttp/server.go index bb54abf9c..0ac36a2a4 100644 --- a/roomserver/inthttp/server.go +++ b/roomserver/inthttp/server.go @@ -33,7 +33,9 @@ func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) { if err := json.NewDecoder(req.Body).Decode(&request); err != nil { return util.MessageResponse(http.StatusBadRequest, err.Error()) } - r.PerformInvite(req.Context(), &request, &response) + if err := r.PerformInvite(req.Context(), &request, &response); err != nil { + return util.ErrorResponse(err) + } return util.JSONResponse{Code: http.StatusOK, JSON: &response} }), )