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 committed by Martin Dosch
parent a9c651cbb4
commit 8ce67a61e0

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.