Commit 120f3484 authored by Jérome Perrin's avatar Jérome Perrin

When we reraise different CorruptedOOoFile exception, at least keep the

original message, also change the log severity to DEBUG



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31584 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 888d6fe9
...@@ -234,12 +234,12 @@ class OOoParser(Implicit): ...@@ -234,12 +234,12 @@ class OOoParser(Implicit):
# Try to unzip the Open Office doc # Try to unzip the Open Office doc
try: try:
oo_unzipped = ZipFile(file_descriptor, mode="r") oo_unzipped = ZipFile(file_descriptor, mode="r")
except: except Exception, e:
LOG('ERP5OOo', PROBLEM, 'Error in openFile', error=sys.exc_info()) LOG('ERP5OOo', DEBUG, 'Error in openFile', error=sys.exc_info())
raise CorruptedOOoFile() raise CorruptedOOoFile(e)
# Test the integrity of the file # Test the integrity of the file
if oo_unzipped.testzip() != None: if oo_unzipped.testzip() is not None:
raise CorruptedOOoFile() raise CorruptedOOoFile('Invalid zip file')
# Get the filename # Get the filename
self.filename = getattr(file_descriptor, 'filename', 'default_filename') self.filename = getattr(file_descriptor, 'filename', 'default_filename')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment