[Erp5-report] r31584 jerome - /erp5/trunk/products/ERP5OOo/OOoUtils.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 5 18:24:33 CET 2010


Author: jerome
Date: Tue Jan  5 18:24:30 2010
New Revision: 31584

URL: http://svn.erp5.org?rev=31584&view=rev
Log:
When we reraise different CorruptedOOoFile exception, at least keep the
original message, also change the log severity to DEBUG


Modified:
    erp5/trunk/products/ERP5OOo/OOoUtils.py

Modified: erp5/trunk/products/ERP5OOo/OOoUtils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/OOoUtils.py?rev=31584&r1=31583&r2=31584&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/OOoUtils.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/OOoUtils.py [utf8] Tue Jan  5 18:24:30 2010
@@ -234,12 +234,12 @@
     # Try to unzip the Open Office doc
     try:
       oo_unzipped = ZipFile(file_descriptor, mode="r")
-    except:
-      LOG('ERP5OOo', PROBLEM, 'Error in openFile', error=sys.exc_info())
-      raise CorruptedOOoFile()
+    except Exception, e:
+      LOG('ERP5OOo', DEBUG, 'Error in openFile', error=sys.exc_info())
+      raise CorruptedOOoFile(e)
     # Test the integrity of the file
-    if oo_unzipped.testzip() != None:
-      raise CorruptedOOoFile()
+    if oo_unzipped.testzip() is not None:
+      raise CorruptedOOoFile('Invalid zip file')
 
     # Get the filename
     self.filename = getattr(file_descriptor, 'filename', 'default_filename')




More information about the Erp5-report mailing list