MatchRoomSubscription: include room ID in err msg

This commit is contained in:
David Robertson 2023-07-18 10:36:20 +01:00
parent 4e387ca9f0
commit 790ae22726
No known key found for this signature in database
GPG Key ID: 903ECE108A39DEDD

View File

@ -222,11 +222,11 @@ func MatchRoomSubscription(roomID string, matchers ...RoomMatcher) RespMatcher {
return func(res *sync3.Response) error {
room, ok := res.Rooms[roomID]
if !ok {
return fmt.Errorf("MatchRoomSubscription: want sub for %s but it was missing", roomID)
return fmt.Errorf("MatchRoomSubscription[%s]: want sub but it was missing", roomID)
}
for _, m := range matchers {
if err := m(room); err != nil {
return fmt.Errorf("MatchRoomSubscription: %s", err)
return fmt.Errorf("MatchRoomSubscription[%s]: %s", roomID, err)
}
}
return nil