From 14d4043b418fd4a43185f86962d247c6fe16dbdd Mon Sep 17 00:00:00 2001 From: Sam Wedgwood Date: Tue, 18 Jul 2023 15:42:08 +0100 Subject: [PATCH] add a few debug logs --- clientapi/routing/room_hierarchy.go | 1 + federationapi/routing/query.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/clientapi/routing/room_hierarchy.go b/clientapi/routing/room_hierarchy.go index e314d07c8..b3c8e5900 100644 --- a/clientapi/routing/room_hierarchy.go +++ b/clientapi/routing/room_hierarchy.go @@ -143,6 +143,7 @@ func QueryRoomHierarchy(req *http.Request, device *userapi.Device, roomIDStr str if err != nil { switch err.(type) { case roomserverAPI.ErrRoomUnknownOrNotAllowed: + util.GetLogger(req.Context()).WithError(err).Debugln("room unknown/forbidden when handling CS room hierarchy request") return util.JSONResponse{ Code: http.StatusForbidden, JSON: spec.Forbidden("room is unknown/forbidden"), diff --git a/federationapi/routing/query.go b/federationapi/routing/query.go index 8b37fbe7b..f7957b3de 100644 --- a/federationapi/routing/query.go +++ b/federationapi/routing/query.go @@ -151,6 +151,7 @@ func QueryRoomHierarchy(httpReq *http.Request, request *fclient.FederationReques if err != nil { switch err.(type) { case roomserverAPI.ErrRoomUnknownOrNotAllowed: + util.GetLogger(httpReq.Context()).WithError(err).Debugln("room unknown/forbidden when handling SS room hierarchy request") return util.JSONResponse{ Code: http.StatusNotFound, JSON: spec.NotFound("room is unknown/forbidden"), @@ -165,6 +166,7 @@ func QueryRoomHierarchy(httpReq *http.Request, request *fclient.FederationReques } if len(discoveredRooms) == 0 { + util.GetLogger(httpReq.Context()).Debugln("no rooms found when handling SS room hierarchy request") return util.JSONResponse{ Code: 404, JSON: spec.NotFound("room is unknown/forbidden"),