[r21153]PdfDocGen: Report cause of failure on all exceptions

not just file open ones. Expat can raise exceptions too!

svn: r21401
This commit is contained in:
John Ralls 2013-02-24 00:53:20 +00:00
parent 0986d69429
commit 592f68ab6e

View File

@ -95,8 +95,9 @@ class PdfDoc(libcairodoc.CairoDoc):
except IOError as msg:
errmsg = "%s\n%s" % (_("Could not create %s") % filename, msg)
raise ReportError(errmsg)
except:
raise ReportError(_("Could not create %s") % filename)
except Exception as err:
errmsg = "%s\n%s" % (_("Could not create %s") % filename, err)
raise ReportError(errmsg)
surface.set_fallback_resolution(300, 300)
cr = cairo.Context(surface)
fontmap = PangoCairo.font_map_new()