Handle exceptions during parsing. Showed up when the domain of one of our
authorMagnus Hagander <magnus@hagander.net>
Mon, 27 Oct 2008 18:40:35 +0000 (18:40 +0000)
committerMagnus Hagander <magnus@hagander.net>
Mon, 27 Oct 2008 18:40:35 +0000 (18:40 +0000)
aggregated blogs dropped off DNS... Oops.

aggregator.py

index ddfa1553a879d5c00af47868ac68ed254549f132..b73c467b72de1621762e290340691002602f4c81 100755 (executable)
@@ -23,7 +23,11 @@ class Aggregator:
                feeds = self.db.cursor()
                feeds.execute('SELECT id,feedurl,name,lastget FROM planet.feeds')
                for feed in feeds.fetchall():
-                       self.ParseFeed(feed)
+                       try:
+                               self.ParseFeed(feed)
+                       except Exception, e:
+                               print "Exception when parsing feed '%s': %s" % (feed[1], e)
+
                self.db.commit()
 
        def ParseFeed(self, feedinfo):