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/win_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/win_main.c')
-rw-r--r-- | apps/win_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/win_main.c b/apps/win_main.c index da97b011..92f7f085 100644 --- a/apps/win_main.c +++ b/apps/win_main.c @@ -98,7 +98,7 @@ void winerror(pdfapp_t *app, fz_error error) int i; /* TODO: redirect stderr to a log file and display here */ - fz_catch(error, "displaying error message to user"); + fz_error_handle(error, "displaying error message to user"); fz_strlcpy(msgbuf, "An error has occurred.\n\n", sizeof msgbuf); for (i = 0; i < fz_get_error_count(); i++) @@ -122,7 +122,7 @@ void win32error(char *msg) code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&buf, 0, NULL); - winerror(&gapp, fz_throw("%s:\n%s", msg, buf)); + winerror(&gapp, fz_error_make("%s:\n%s", msg, buf)); } int winfilename(wchar_t *buf, int len) @@ -617,7 +617,7 @@ void winreloadfile(pdfapp_t *app) fd = _wopen(wbuf, O_BINARY | O_RDONLY, 0666); if (fd < 0) - winerror(&gapp, fz_throw("cannot reload file '%s'", filename)); + winerror(&gapp, fz_error_make("cannot reload file '%s'", filename)); pdfapp_open(app, filename, fd, 1); } @@ -875,7 +875,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShow fd = _wopen(wbuf, 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)); code = WideCharToMultiByte(CP_UTF8, 0, wbuf, -1, filename, sizeof filename, NULL, NULL); if (code == 0) |