From 4399fc108f18000715ec6ee8caa7b50f601ad21f Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Wed, 25 May 2011 17:38:32 -0400 Subject: [PATCH] Fixed a silent error when OpenOffice fails to open a file.\ Also, added the file name to the exception log and made the exception explicit --- openlp/plugins/songs/lib/oooimport.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index f570f33d3..a03a36121 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -80,6 +80,10 @@ class OooImport(SongImport): if self.document: self.process_ooo_document() self.close_ooo_file() + else: + self.log_error(self.filepath) + else: + self.log_error(self.filepath) self.close_ooo() def process_ooo_document(self): @@ -160,8 +164,8 @@ class OooImport(SongImport): else: self.import_wizard.incrementProgressBar( u'Processing file ' + filepath, 0) - except: - log.exception("open_ooo_file failed") + except AttributeError: + log.exception("open_ooo_file failed: %s", url) return def close_ooo_file(self):