changeset 10:01a86b178e60

catch the FeedUpdateException that might be raised when updating a feed, print it and continue with next feed
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 27 Apr 2010 20:08:21 +0200
parents fd4c8bfa62d6
children e87c54b3a216
files FeedUpdater.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/FeedUpdater.py	Tue Apr 27 10:22:35 2010 +0200
+++ b/FeedUpdater.py	Tue Apr 27 20:08:21 2010 +0200
@@ -9,7 +9,10 @@
 def updateAllFeeds(session):
     allFeeds = session.query(Feed)
     for feed in allFeeds:
-        FeedUpdater(session, feed).update()
+        try:
+            FeedUpdater(session, feed).update()
+        except FeedUpdateException:
+            print("problems while updating feed " + feed.rss_url)
         session.commit()
 
 class FeedUpdater(object):
@@ -44,4 +47,4 @@
         self.session.add(new)
 
 class FeedUpdateException(Exception):
-    pass
\ No newline at end of file
+    pass