From ccd13c8499d6a2a2672bc8d4007b51fa3543d4cc Mon Sep 17 00:00:00 2001 From: Taka Date: Wed, 3 May 2017 08:03:49 +0000 Subject: [PATCH] Show a better error message (on Windows) if Ghostscript is not installed. --- asl_cards/parse.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/asl_cards/parse.py b/asl_cards/parse.py index cabcd23..2ecde3d 100644 --- a/asl_cards/parse.py +++ b/asl_cards/parse.py @@ -110,6 +110,10 @@ class PdfParser: except AnalyzeCancelledException as ex : raise except Exception as ex : + if str(ex).lower().find( "can not find ghostscript dll" ) >= 0 : + # NOTE: We get a RuntimeError if Ghostscript is not installed :-/ + # We bail, since there's no point trying to parse any more files. + raise # notify the caller of the error if not self.on_error : raise