From 2499888ffb46084735ae7d0cc21c73862f2175e5 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Tue, 4 Jan 2011 16:45:42 +0000
Subject: [PATCH] * non-batch mode (i.e. calling from UI), we need to have
 exception without retrying with activity. * remove needless duplicate code.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42003 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Tool/ContributionTool.py | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/product/ERP5/Tool/ContributionTool.py b/product/ERP5/Tool/ContributionTool.py
index c444c0860c..acd964f788 100644
--- a/product/ERP5/Tool/ContributionTool.py
+++ b/product/ERP5/Tool/ContributionTool.py
@@ -616,25 +616,13 @@ class ContributionTool(BaseTool):
         # If this is an index document, stop crawling if crawling_depth is 0
         document.activate().crawlContent()
     except urllib2.HTTPError, error:
-      if repeat == 0 and batch_mode:
+      if repeat == 0 or not batch_mode:
         # here we must call the extendBadURLList method,--NOT Implemented--
         # which had to add this url to bad URL list, so next time we avoid
         # crawling bad URL
         raise
       if repeat > 0:
         # Catch any HTTP error
-        self.activate(at_date=DateTime() + repeat_interval).newContentFromURL(
-                          container_path=container_path, url=url,
-                          repeat=repeat - 1,
-                          repeat_interval=repeat_interval, **kw)
-    except urllib2.URLError, error:
-      if repeat == 0 and batch_mode:
-        # XXX - Call the extendBadURLList method, --NOT Implemented--
-        raise
-      #if getattr(error.reason,'args',None):
-        #if error.reason.args[0] == socket.EAI_AGAIN:
-          ## Temporary failure in name resolution - try again in 1 day
-      if repeat > 0:
         self.activate(at_date=DateTime() + repeat_interval,
                       activity="SQLQueue").newContentFromURL(
                         container_path=container_path, url=url,
-- 
2.30.9