catch ppt-dump errors to avoid bogus system reports

This commit is contained in:
Jean-Francois Dockes 2014-05-06 11:39:27 +02:00
parent e867f855ad
commit 28a4e4d8a8
3 changed files with 12 additions and 4 deletions

Binary file not shown.

View File

@ -116,9 +116,13 @@ def main (args):
usage(exname)
return
dumper = PPTDumper(args[0], globals.params)
if not dumper.dump():
error("FAILURE\n")
try:
dumper = PPTDumper(args[0], globals.params)
if not dumper.dump():
error("ppt-dump: dump error\n")
except:
error("ppt-dump: FAILURE (bad format?)\n")
if globals.params.dumpText:
print(globals.textdump.replace("\r", "\n"))

View File

@ -45,4 +45,8 @@ class XlsXmlHandler(xml.sax.handler.ContentHandler):
elif name == "worksheet":
print("")
xml.sax.parse(sys.stdin, XlsXmlHandler())
try:
xml.sax.parse(sys.stdin, XlsXmlHandler())
except:
sys.exit(1)
sys.exit(0)