From ef2339ddcdf32a0e62b38ec5194ff1fdad874c77 Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Mon, 14 May 2007 10:31:30 +0000 Subject: [PATCH] Raise exception if impossible to conver to base format (OOOd). Because convertToBaseFormat is usually called upon indexing do NOT call workflow script processFile (for OOOd failure) because it will trigger another object indexing activity, thus creating an infinitive loop and growing ZODB. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14470 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Document.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py index ed83c7f96f..93dd091f2d 100644 --- a/product/ERP5/Document/Document.py +++ b/product/ERP5/Document/Document.py @@ -958,7 +958,7 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): user_login - this is a login string of a person; can be None if the user is currently logged in, then we'll get him from session - """ + """ if file_name is not None: # filename is often undefined.... self._setSourceReference(file_name) @@ -1138,13 +1138,16 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): msg = '' except ConversionError, e: msg = 'Problem: %s' % (str(e) or 'undefined.') - self.processFile(comment=msg) + #self.processFile(comment=msg) + raise ConversionError, msg except Fault, e: msg = 'Problem: %s' % (repr(e) or 'undefined.') - self.processFile(comment=msg) + #self.processFile(comment=msg) + raise Fault, msg except socket.error, e: msg = 'Problem: %s' % (repr(e) or 'undefined.') - self.processFile(comment=msg) + #self.processFile(comment=msg) + raise socket.error, msg return msg def _convertToBaseFormat(self): -- 2.30.9