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 87c5b6632a
commit 90e07c8cfc

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