From 29a8bd37d5f0d10ee3b306caeee9a9d46247b02e Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Fri, 24 Aug 2018 21:44:42 -0400 Subject: useful error message when writing embroidery file fails (fixes #279) --- lib/output.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/output.py b/lib/output.py index d5c513e2..1278c5b1 100644 --- a/lib/output.py +++ b/lib/output.py @@ -84,4 +84,10 @@ def write_embroidery_file(file_path, stitch_plan, svg): "full_jump": True, } - pyembroidery.write(pattern, file_path, settings) + try: + pyembroidery.write(pattern, file_path, settings) + except IOError as e: + # L10N low-level file error. %(error)s is (hopefully?) translated by + # the user's system automatically. + print >> sys.stderr, _("Error writing to %(path)s: %(error)s") % dict(path=file_path, error=e.message) + sys.exit(1) -- cgit v1.2.3