Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better error checking - show actual exceptions when status field is

not present, instead of just reporting that status was missing.
  • Loading branch information...
commit 01557f1234c2d11aed0e945213c04282e015472a 1 parent 02bd694
@mhagander authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 aggregator.py
View
7 aggregator.py
@@ -47,6 +47,13 @@ def ParseFeed(self, feedinfo):
numadded = 0
parsestart = datetime.datetime.now()
feed = feedparser.parse(feedinfo[1], modified=feedinfo[3].timetuple())
+
+ if not hasattr(feed, 'status'):
+ # bozo_excpetion can seemingly be set when there is no error as well,
+ # so make sure we only check if we didn't get a status.
+ if hasattr(feed,'bozo_exception'):
+ raise Exception('Feed load error %s' % feed.bozo_exception)
+ raise Exception('Feed load error with not exception!')
if feed.status == 304:
# not changed
Please sign in to comment.
Something went wrong with that request. Please try again.