don't crash if we can't fetch data or if xml is malformed
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 27 May 2011 13:57:25 +0200
changeset 7447 d5705c9bbe82
parent 7446 6fba86efdd09
child 7454 1090724f28ed
don't crash if we can't fetch data or if xml is malformed
server/sources/datafeed.py
--- a/server/sources/datafeed.py	Fri May 27 11:17:02 2011 +0200
+++ b/server/sources/datafeed.py	Fri May 27 13:57:25 2011 +0200
@@ -269,8 +269,13 @@
 
     def process(self, url, raise_on_error=False, partialcommit=True):
         """IDataFeedParser main entry point"""
+        try:
+            parsed = self.parse(url)
+        except Exception, ex:
+            self.source.error(ex)
+            return True
         error = False
-        for args in self.parse(url):
+        for args in parsed:
             try:
                 self.process_item(*args)
                 if partialcommit: