From a0e256711d5a03c262343d6cdd73e0519673f75e Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Tue, 23 May 2023 18:06:47 +0200 Subject: [PATCH] Fix logging --- federationapi/routing/join.go | 8 ++++---- federationapi/routing/leave.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index 19e887163..4cbfc5e87 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -162,13 +162,13 @@ func MakeJoin( switch e := internalErr.(type) { case nil: case spec.InternalServerError: - util.GetLogger(httpReq.Context()).WithError(internalErr) + util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_join request") return util.JSONResponse{ Code: http.StatusInternalServerError, JSON: spec.InternalServerError{}, } case spec.MatrixError: - util.GetLogger(httpReq.Context()).WithError(internalErr) + util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_join request") code := http.StatusInternalServerError switch e.ErrCode { case spec.ErrorForbidden: @@ -186,13 +186,13 @@ func MakeJoin( JSON: e, } case spec.IncompatibleRoomVersionError: - util.GetLogger(httpReq.Context()).WithError(internalErr) + util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_join request") return util.JSONResponse{ Code: http.StatusBadRequest, JSON: e, } default: - util.GetLogger(httpReq.Context()).WithError(internalErr) + util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_join request") return util.JSONResponse{ Code: http.StatusBadRequest, JSON: spec.Unknown("unknown error"), diff --git a/federationapi/routing/leave.go b/federationapi/routing/leave.go index 024437907..3e576e09c 100644 --- a/federationapi/routing/leave.go +++ b/federationapi/routing/leave.go @@ -101,13 +101,13 @@ func MakeLeave( switch e := internalErr.(type) { case nil: case spec.InternalServerError: - util.GetLogger(httpReq.Context()).WithError(internalErr) + util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_leave request") return util.JSONResponse{ Code: http.StatusInternalServerError, JSON: spec.InternalServerError{}, } case spec.MatrixError: - util.GetLogger(httpReq.Context()).WithError(internalErr) + util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_leave request") code := http.StatusInternalServerError switch e.ErrCode { case spec.ErrorForbidden: @@ -123,7 +123,7 @@ func MakeLeave( JSON: e, } default: - util.GetLogger(httpReq.Context()).WithError(internalErr) + util.GetLogger(httpReq.Context()).WithError(internalErr).Error("failed to handle make_leave request") return util.JSONResponse{ Code: http.StatusBadRequest, JSON: spec.Unknown("unknown error"),