1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 16:28:11 +00:00

Catch configuration file parsing errors

Fix #176
This commit is contained in:
Julien Duponchelle 2015-05-05 11:44:35 +02:00
parent b7dac1bec4
commit a3f00e1f45

View File

@ -135,7 +135,11 @@ class Config(object):
Read the configuration files.
"""
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: