From 89ae81f651bfa112b8e07317eb6983beaf7cb212 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Sun, 11 Sep 2011 19:29:42 -0500 Subject: Initial import of exception handling code Import exception handling code from WSS, modified to fit into the fitz world. With this code we have 'real' fz_try/fz_catch/fz_rethrow functions, handling a fz_except type. We therefore rename the existing fz_throw/ fz_catch/fz_rethrow to be fz_error_make/fz_error_handle/fz_error_note. We don't actually use fz_try/fz_catch/fz_rethrow yet... --- pdf/pdf_type3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pdf/pdf_type3.c') diff --git a/pdf/pdf_type3.c b/pdf/pdf_type3.c index 1d851ebe..1d814ddd 100644 --- a/pdf/pdf_type3.c +++ b/pdf/pdf_type3.c @@ -49,7 +49,7 @@ pdf_load_type3_font(pdf_font_desc **fontdescp, pdf_xref *xref, fz_obj *rdb, fz_o encoding = fz_dict_gets(dict, "Encoding"); if (!encoding) { - error = fz_throw("syntaxerror: Type3 font missing Encoding"); + error = fz_error_make("syntaxerror: Type3 font missing Encoding"); goto cleanup; } @@ -98,7 +98,7 @@ pdf_load_type3_font(pdf_font_desc **fontdescp, pdf_xref *xref, fz_obj *rdb, fz_o widths = fz_dict_gets(dict, "Widths"); if (!widths) { - error = fz_throw("syntaxerror: Type3 font missing Widths"); + error = fz_error_make("syntaxerror: Type3 font missing Widths"); goto cleanup; } @@ -130,7 +130,7 @@ pdf_load_type3_font(pdf_font_desc **fontdescp, pdf_xref *xref, fz_obj *rdb, fz_o charprocs = fz_dict_gets(dict, "CharProcs"); if (!charprocs) { - error = fz_throw("syntaxerror: Type3 font missing CharProcs"); + error = fz_error_make("syntaxerror: Type3 font missing CharProcs"); goto cleanup; } @@ -154,5 +154,5 @@ pdf_load_type3_font(pdf_font_desc **fontdescp, pdf_xref *xref, fz_obj *rdb, fz_o cleanup: fz_drop_font(fontdesc->font); fz_free(fontdesc); - return fz_rethrow(error, "cannot load type3 font (%d %d R)", fz_to_num(dict), fz_to_gen(dict)); + return fz_error_note(error, "cannot load type3 font (%d %d R)", fz_to_num(dict), fz_to_gen(dict)); } -- cgit v1.2.3