summaryrefslogtreecommitdiff
path: root/xps/xps_resource.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-09-11 19:29:42 -0500
committerRobin Watts <robin.watts@artifex.com>2011-09-14 17:44:13 +0100
commit89ae81f651bfa112b8e07317eb6983beaf7cb212 (patch)
tree3f99dad1253b795629e66d45b915c1d72043242b /xps/xps_resource.c
parentcefb81f1886685580a40b17b5e495a8a8a1ebeaf (diff)
downloadmupdf-89ae81f651bfa112b8e07317eb6983beaf7cb212.tar.xz
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...
Diffstat (limited to 'xps/xps_resource.c')
-rw-r--r--xps/xps_resource.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xps/xps_resource.c b/xps/xps_resource.c
index c96f3619..bd414894 100644
--- a/xps/xps_resource.c
+++ b/xps/xps_resource.c
@@ -68,21 +68,21 @@ xps_parse_remote_resource_dictionary(xps_context *ctx, xps_resource **dictp, cha
part = xps_read_part(ctx, part_name);
if (!part)
{
- return fz_throw("cannot find remote resource part '%s'", part_name);
+ return fz_error_make("cannot find remote resource part '%s'", part_name);
}
xml = xml_parse_document(part->data, part->size);
if (!xml)
{
xps_free_part(ctx, part);
- return fz_rethrow(-1, "cannot parse xml");
+ return fz_error_note(-1, "cannot parse xml");
}
if (strcmp(xml_tag(xml), "ResourceDictionary"))
{
xml_free_element(xml);
xps_free_part(ctx, part);
- return fz_throw("expected ResourceDictionary element (found %s)", xml_tag(xml));
+ return fz_error_make("expected ResourceDictionary element (found %s)", xml_tag(xml));
}
fz_strlcpy(part_uri, part_name, sizeof part_uri);
@@ -95,7 +95,7 @@ xps_parse_remote_resource_dictionary(xps_context *ctx, xps_resource **dictp, cha
{
xml_free_element(xml);
xps_free_part(ctx, part);
- return fz_rethrow(code, "cannot parse remote resource dictionary: %s", part_uri);
+ return fz_error_note(code, "cannot parse remote resource dictionary: %s", part_uri);
}
dict->base_xml = xml; /* pass on ownership */
@@ -121,7 +121,7 @@ xps_parse_resource_dictionary(xps_context *ctx, xps_resource **dictp, char *base
{
code = xps_parse_remote_resource_dictionary(ctx, dictp, base_uri, source);
if (code)
- return fz_rethrow(code, "cannot parse remote resource dictionary");
+ return fz_error_note(code, "cannot parse remote resource dictionary");
return fz_okay;
}