prevent exception if unable to resolve final link

This commit is contained in:
Ronald Schaten 2013-04-09 12:39:12 +02:00
parent ec565eda7d
commit 7e6c660b0c

View File

@ -79,9 +79,12 @@ class Entry(Base):
print ' fetching final link <%s>' % entry.link
request = urllib2.Request(entry.link)
opener = urllib2.build_opener()
try:
result = opener.open(request)
self.resolvedlink = result.url
print ' final link: <%s>' % result.url
except:
print ' FAILED opening URL'
if feed.fullpage:
print ' fetching full page <%s>' % entry.link
self.fullpage = fetch_full_page(entry.link)