diff options
author | Tor Andersson <tor@ghostscript.com> | 2008-11-05 14:29:26 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2008-11-05 14:29:26 +0100 |
commit | cba6e28dfceca6f02dd7c93a01b735510fbda7a5 (patch) | |
tree | eedde55a424311cf79f7e5d1b8d7e31e268f216e /apps | |
parent | 59947bb324a07b060b98e4faed5f005e83892ba7 (diff) | |
download | mupdf-cba6e28dfceca6f02dd7c93a01b735510fbda7a5.tar.xz |
Show stack trace in windows error dialog.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/windows/winmain.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/windows/winmain.c b/apps/windows/winmain.c index cc7f3bdb..678736f1 100644 --- a/apps/windows/winmain.c +++ b/apps/windows/winmain.c @@ -109,7 +109,19 @@ void winwarn(pdfapp_t *app, char *msg) void winerror(pdfapp_t *app, fz_error *error) { - MessageBoxA(hwndframe, error->msg, "MuPDF: Error", MB_ICONERROR); + char msg[4096]; + char buf[200]; + + msg[0] = 0; + + while (error) + { + sprintf(buf, "%s:%d: %s(): %s\n", error->file, error->line, error->func, error->msg); + strcat(msg, buf); + error = error->cause; + } + + MessageBoxA(hwndframe, msg, "MuPDF: Error", MB_ICONERROR); exit(1); } |