From 678a25191da6ead5f7e247d931c2668db41c6fd6 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 15 Oct 2014 13:29:05 +0100 Subject: [PATCH] Better errors on failed squeeze --- cpdf.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpdf.ml b/cpdf.ml index c8a1db4..223bd7a 100644 --- a/cpdf.ml +++ b/cpdf.ml @@ -249,7 +249,12 @@ let squeeze pdf = Pdfcodec.flate_level := 9; ignore (recompress_pdf pdf) with - e -> raise (Pdf.PDFError "Squeeze failed. No output written") + e -> + raise + (Pdf.PDFError + (Printf.sprintf + "Squeeze failed. No output written.\n Proximate error was:\n %s" + (Printexc.to_string e))) type encoding = | Raw