From a2cb08e2fdc06d2055f2f1856f6e9c3c763e7714 Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Fri, 1 Feb 2019 14:58:12 +0100 Subject: [PATCH] Changed behaviour to not crash if the feed is unavailable. --- getarticles.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/getarticles.go b/getarticles.go index 5431a68..aa906a3 100644 --- a/getarticles.go +++ b/getarticles.go @@ -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.