summaryrefslogtreecommitdiff
path: root/source/tools/mudraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/tools/mudraw.c')
-rw-r--r--source/tools/mudraw.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
index 7b77f195..6134b12d 100644
--- a/source/tools/mudraw.c
+++ b/source/tools/mudraw.c
@@ -1042,10 +1042,30 @@ static void drawrange(fz_context *ctx, fz_document *doc, const char *range)
{
if (spage < epage)
for (page = spage; page <= epage; page++)
- drawpage(ctx, doc, page);
+ {
+ fz_try(ctx)
+ drawpage(ctx, doc, page);
+ fz_catch(ctx)
+ {
+ if (ignore_errors)
+ fz_warn(ctx, "ignoring error on page %d in '%s'", page, filename);
+ else
+ fz_rethrow(ctx);
+ }
+ }
else
for (page = spage; page >= epage; page--)
- drawpage(ctx, doc, page);
+ {
+ fz_try(ctx)
+ drawpage(ctx, doc, page);
+ fz_catch(ctx)
+ {
+ if (ignore_errors)
+ fz_warn(ctx, "ignoring error on page %d in '%s'", page, filename);
+ else
+ fz_rethrow(ctx);
+ }
+ }
}
}