From a3f00e1f4507383fba9a5eff74f4bafbc6918a51 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 5 May 2015 11:44:35 +0200 Subject: [PATCH] Catch configuration file parsing errors Fix #176 --- gns3server/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gns3server/config.py b/gns3server/config.py index 3f69575a3..7266a0d25 100644 --- a/gns3server/config.py +++ b/gns3server/config.py @@ -135,7 +135,11 @@ class Config(object): Read the configuration files. """ - parsed_files = self._config.read(self._files, encoding="utf-8") + try: + parsed_files = self._config.read(self._files, encoding="utf-8") + except configparser.Error as e: + log.error("Can't parse configuration file: %s", str(e)) + return if not parsed_files: log.warning("No configuration file could be found or read") else: