diff options
author | Sebastian Reichel <sre@ring0.de> | 2013-03-27 00:06:53 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2013-03-27 00:06:53 +0100 |
commit | d6bdcc8895e38e8b4a61dd6e550103bce44e71b3 (patch) | |
tree | 9354480352fd5db323edb10f2595d3e28c6fa108 /src/pdf-invoice | |
parent | 52ea2214a6bb2b6e07def04cffd1bc2553d64077 (diff) | |
download | serial-barcode-scanner-d6bdcc8895e38e8b4a61dd6e550103bce44e71b3.tar.bz2 |
handle errors
Diffstat (limited to 'src/pdf-invoice')
-rw-r--r-- | src/pdf-invoice/pdf-invoice.vala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pdf-invoice/pdf-invoice.vala b/src/pdf-invoice/pdf-invoice.vala index 095dcc6..8a6242d 100644 --- a/src/pdf-invoice/pdf-invoice.vala +++ b/src/pdf-invoice/pdf-invoice.vala @@ -52,8 +52,12 @@ public class InvoicePDF { } private void render_svg(Cairo.Context ctx, string file) { - var svg = new Rsvg.Handle.from_file(file); - svg.render_cairo(ctx); + try { + var svg = new Rsvg.Handle.from_file(file); + svg.render_cairo(ctx); + } catch(Error e) { + error("Could not load SVG: %s\n", e.message); + } } private void draw_footer(Cairo.Context ctx) { |