From 5aaff8260abdaefdbf7a64d3e66b1928dfe5d726 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 11 Mar 2009 01:44:12 +0100 Subject: Add fz_catch function, and cause the throw/rethrow/catch functions to print the errors immediately. --- apps/pdfclean.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'apps/pdfclean.c') 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); -- cgit v1.2.3