diff options
author | Magnus Hagander | 2009-02-15 11:09:28 +0000 |
---|---|---|
committer | Magnus Hagander | 2009-02-15 11:09:28 +0000 |
commit | 9624276bc095a1fd41919dde57987c56c7e8807a (patch) | |
tree | dc3927e330b964bf5416f232e870baaec91332d0 | |
parent | 9032b1d4722dcc310602b4c8e4d661b1703c0263 (diff) |
Better error checking - show actual exceptions when status field is
not present, instead of just reporting that status was missing.
git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2412 8f5c7a92-453e-0410-a47f-ad33c8a6b003
-rwxr-xr-x | planet/aggregator.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/planet/aggregator.py b/planet/aggregator.py index 83f90026..20de7f75 100755 --- a/planet/aggregator.py +++ b/planet/aggregator.py @@ -47,6 +47,13 @@ class Aggregator: 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 |