Browse Source

Return an error so it is logged

pull/134/head
Kegan Dougal 8 years ago
parent
commit
677b556376
  1. 6
      src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go

6
src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go

@ -243,7 +243,11 @@ func (s *Service) queryFeed(feedURL string) (*gofeed.Feed, []gofeed.Item, error)
feed, err := fp.ParseURL(feedURL)
// check for no items in addition to any returned errors as it appears some RSS feeds
// do not consistently return items.
if err != nil || len(feed.Items) == 0 {
if err == nil && len(feed.Items) == 0 {
err = errors.New("feed has 0 items")
}
if err != nil {
f := s.Feeds[feedURL]
f.IsFailing = true
s.Feeds[feedURL] = f

Loading…
Cancel
Save