summaryrefslogtreecommitdiff
path: root/apps/pdfclean.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-03-11 01:44:12 +0100
committerTor Andersson <tor@ghostscript.com>2009-03-11 01:44:12 +0100
commit5aaff8260abdaefdbf7a64d3e66b1928dfe5d726 (patch)
treefebd7d6938978dac98dc0f7e6e501df46b6e3754 /apps/pdfclean.c
parent5733fd611487151f33338b1ecda4819c26ccd25f (diff)
downloadmupdf-5aaff8260abdaefdbf7a64d3e66b1928dfe5d726.tar.xz
Add fz_catch function, and cause the throw/rethrow/catch functions to print the errors immediately.
Diffstat (limited to 'apps/pdfclean.c')
-rw-r--r--apps/pdfclean.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/apps/pdfclean.c b/apps/pdfclean.c
index 7a8cc0fc..58fc9b68 100644
--- a/apps/pdfclean.c
+++ b/apps/pdfclean.c
@@ -26,10 +26,7 @@ int doexpand = 0;
void die(fz_error *eo)
{
- fflush(stdout);
- fz_printerror(eo);
- fz_droperror(eo);
- fflush(stderr);
+ fz_catch(eo, "aborting");
exit(1);
}
@@ -45,9 +42,7 @@ void openxref(char *filename, char *password)
error = pdf_loadxref(xref, filename);
if (error)
{
- fz_printerror(error);
- fz_droperror(error);
- fz_warn("trying to repair");
+ fz_catch(error, "trying to repair");
error = pdf_repairxref(xref, filename);
if (error)
die(error);