mirror of
https://salsa.debian.org/mdosch/feed-to-muc.git
synced 2024-11-10 00:06:49 +01:00
Changed behaviour to not crash if the feed is unavailable.
This commit is contained in:
parent
195dd6a1c6
commit
a2cb08e2fd
1 changed files with 4 additions and 1 deletions
|
@ -120,7 +120,10 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) {
|
||||||
fp := gofeed.NewParser()
|
fp := gofeed.NewParser()
|
||||||
feed, err := fp.ParseURL(feedURL)
|
feed, err := fp.ParseURL(feedURL)
|
||||||
if err != nil {
|
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.
|
// If no publish date is offered try update date.
|
||||||
|
|
Loading…
Reference in a new issue