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):
# 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')
......
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