From 0d8182086321f6f57ff5cf81e722a7c343476118 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Wed, 24 Mar 2021 07:56:26 +0000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Tulir Asokan --- services/rssbot/rssbot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/rssbot/rssbot.go b/services/rssbot/rssbot.go index 35235cb..1e46cce 100644 --- a/services/rssbot/rssbot.go +++ b/services/rssbot/rssbot.go @@ -418,7 +418,7 @@ func (s *Service) sendToRooms(cli types.MatrixClient, feedURL string, feed *gofe logger.Info("Sending new feed item") for _, roomID := range s.Feeds[feedURL].Rooms { if _, err := cli.SendMessageEvent(roomID, mevt.EventMessage, itemToHTML(feed, item)); err != nil { - if err.Code == 429 { + if httpErr, ok := err.(mautrix.HTTPError); ok && httpErr.IsStatus(429) { return err } else { logger.WithError(err).WithField("room_id", roomID).Error("Failed to send to room")