diff options
-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); |