diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-09-11 19:29:42 -0500 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-09-14 17:44:13 +0100 |
commit | 89ae81f651bfa112b8e07317eb6983beaf7cb212 (patch) | |
tree | 3f99dad1253b795629e66d45b915c1d72043242b /apps/x11_main.c | |
parent | cefb81f1886685580a40b17b5e495a8a8a1ebeaf (diff) | |
download | mupdf-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 'apps/x11_main.c')
-rw-r--r-- | apps/x11_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/x11_main.c b/apps/x11_main.c index c2aef917..d719abda 100644 --- a/apps/x11_main.c +++ b/apps/x11_main.c @@ -102,7 +102,7 @@ void winwarn(pdfapp_t *app, char *msg) void winerror(pdfapp_t *app, fz_error error) { - fz_catch(error, "aborting"); + fz_error_handle(error, "aborting"); exit(1); } @@ -124,7 +124,7 @@ static void winopen(void) xdpy = XOpenDisplay(NULL); if (!xdpy) - winerror(&gapp, fz_throw("cannot open display")); + winerror(&gapp, fz_error_make("cannot open display")); XA_TARGETS = XInternAtom(xdpy, "TARGETS", False); XA_TIMESTAMP = XInternAtom(xdpy, "TIMESTAMP", False); @@ -158,7 +158,7 @@ static void winopen(void) 0, NULL); if (xwin == None) - winerror(&gapp, fz_throw("cannot create window")); + winerror(&gapp, fz_error_make("cannot create window")); XSetWindowColormap(xdpy, xwin, ximage_get_colormap()); XSelectInput(xdpy, xwin, @@ -487,7 +487,7 @@ void winreloadfile(pdfapp_t *app) fd = open(filename, O_BINARY | O_RDONLY, 0666); if (fd < 0) - winerror(app, fz_throw("cannot reload file '%s'", filename)); + winerror(app, fz_error_make("cannot reload file '%s'", filename)); pdfapp_open(app, filename, fd, 1); } @@ -593,7 +593,7 @@ int main(int argc, char **argv) fd = open(filename, O_BINARY | O_RDONLY, 0666); if (fd < 0) - winerror(&gapp, fz_throw("cannot open file '%s'", filename)); + winerror(&gapp, fz_error_make("cannot open file '%s'", filename)); pdfapp_open(&gapp, filename, fd, 0); |