Changed behaviour to not crash if the feed is unavailable.

This commit is contained in:
Martin Dosch 2019-02-01 14:58:12 +01:00
parent 195dd6a1c6
commit a2cb08e2fd

View file

@ -120,7 +120,10 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) {
fp := gofeed.NewParser()
feed, err := fp.ParseURL(feedURL)
if err != nil {
return "", err
// Don't return an error, but log a message as the
// bot should not crash when the feed is not available.
log.Println(feedURL, ": Feed not available.")
return "", nil
}
// If no publish date is offered try update date.