PdfDocGen: Report cause of failure on all exceptions

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

svn: r21153
This commit is contained in:
John Ralls 2013-01-17 19:48:37 +00:00
parent 42de599bd0
commit b79eb50aba

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()