Skip to content

Commit

Permalink
exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Macbull committed May 4, 2016
1 parent ee0f6b8 commit 6262fb1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions feed_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

def get_feed_entries(url):
"""Method to get feed entry links"""
doc = feedparser.parse(url)
links = []
for feed in doc.entries:
links.append(str(feed.link))
links = []
try:
doc = feedparser.parse(url)
for feed in doc.entries:
links.append(str(feed.link))
except:
pass
return links

0 comments on commit 6262fb1

Please sign in to comment.