diff options
author | Tor Andersson <tor@ghostscript.com> | 2008-03-27 14:56:33 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2008-03-27 14:56:33 +0100 |
commit | a86a6c38e2be0d46c8f95964611111bef427e7c5 (patch) | |
tree | 1828b7394ab3c25ab8a471fa9dcc23cc187d0854 | |
parent | f99152119818762bab738416d789b850a83659e2 (diff) | |
download | mupdf-a86a6c38e2be0d46c8f95964611111bef427e7c5.tar.xz |
Fix error message handling in pdfapp.
-rw-r--r-- | apps/common/pdfapp.c | 2 | ||||
-rw-r--r-- | apps/unix/x11pdf.c | 6 | ||||
-rw-r--r-- | apps/windows/winmain.c | 4 | ||||
-rw-r--r-- | include/pdfapp.h | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/apps/common/pdfapp.c b/apps/common/pdfapp.c index 9e0d4962..138bb661 100644 --- a/apps/common/pdfapp.c +++ b/apps/common/pdfapp.c @@ -23,7 +23,7 @@ void pdfapp_warn(pdfapp_t *app, const char *fmt, ...) void pdfapp_error(pdfapp_t *app, fz_error *error) { - winerror(app, error->msg); + winerror(app, error); } char *pdfapp_usage(pdfapp_t *app) diff --git a/apps/unix/x11pdf.c b/apps/unix/x11pdf.c index baedbe09..d9f0d036 100644 --- a/apps/unix/x11pdf.c +++ b/apps/unix/x11pdf.c @@ -57,9 +57,9 @@ void winwarn(pdfapp_t *app, char *msg) fprintf(stderr, "apparition: %s\n", msg); } -void winerror(pdfapp_t *app, char *msg) +void winerror(pdfapp_t *app, fz_error *error) { - fprintf(stderr, "apparition: %s\n", msg); + fz_printerror(error); exit(1); } @@ -80,7 +80,7 @@ void winopen(void) xdpy = XOpenDisplay(nil); if (!xdpy) - winerror(&gapp, "could not open display."); + winerror(&gapp, fz_throw("could not open display")); XA_TARGETS = XInternAtom(xdpy, "TARGETS", False); XA_TIMESTAMP = XInternAtom(xdpy, "TIMESTAMP", False); diff --git a/apps/windows/winmain.c b/apps/windows/winmain.c index d9c29927..faf1d89c 100644 --- a/apps/windows/winmain.c +++ b/apps/windows/winmain.c @@ -107,9 +107,9 @@ void winwarn(pdfapp_t *app, char *msg) MessageBoxA(hwndframe, msg, "Apparition: Warning", MB_ICONWARNING); } -void winerror(pdfapp_t *app, char *msg) +void winerror(pdfapp_t *app, fz_error *error) { - MessageBoxA(hwndframe, msg, "Apparition: Error", MB_ICONERROR); + MessageBoxA(hwndframe, error->msg, "Apparition: Error", MB_ICONERROR); exit(1); } diff --git a/include/pdfapp.h b/include/pdfapp.h index 0d3c5ec6..9f03505e 100644 --- a/include/pdfapp.h +++ b/include/pdfapp.h @@ -9,7 +9,7 @@ typedef struct pdfapp_s pdfapp_t; enum { ARROW, HAND, WAIT }; extern void winwarn(pdfapp_t*, char *s); -extern void winerror(pdfapp_t*, char *s); +extern void winerror(pdfapp_t*, fz_error *error); extern void wintitle(pdfapp_t*, char *title); extern void winresize(pdfapp_t*, int w, int h); extern void winconvert(pdfapp_t*, fz_pixmap *image); |