From c8700dd06e593f240f9fa43c6e6f73aae05a593c Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 16 Jun 2013 14:50:04 +0200 Subject: =?UTF-8?q?Fail=20properly=20when=20the=20config=20can=E2=80=99t?= =?UTF-8?q?=20be=20parsed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config.py b/src/config.py index 695362e5..92fa503f 100644 --- a/src/config.py +++ b/src/config.py @@ -13,6 +13,7 @@ from/to the config file DEFSECTION = "Poezio" from gettext import gettext as _ +import sys import logging log = logging.getLogger(__name__) @@ -259,4 +260,10 @@ if not path.isfile(options.filename): copy2(other, options.filename) firstrun = True -config = Config(options.filename) +try: + config = Config(options.filename) +except: + import traceback + sys.stderr.write('Poezio was unable to read or parse the config file.\n') + traceback.print_exc(limit=0) + sys.exit(1) -- cgit v1.2.3