Handle invalid config a bit better

This commit is contained in:
samwiseg0 2018-12-30 16:49:35 -05:00
parent 8d4fb3dc18
commit bf0ff4c30c

View file

@ -1,7 +1,7 @@
from logging import getLogger from logging import getLogger
from os.path import join, exists from os.path import join, exists
from re import match, compile, IGNORECASE from re import match, compile, IGNORECASE
from configparser import ConfigParser, NoOptionError from configparser import ConfigParser, NoOptionError, NoSectionError
from varken.helpers import clean_sid_check from varken.helpers import clean_sid_check
from varken.structures import SickChillServer from varken.structures import SickChillServer
@ -22,7 +22,11 @@ class INIParser(object):
self.influx_server = InfluxServer() self.influx_server = InfluxServer()
self.parse_opts() try:
self.parse_opts()
except NoSectionError as e:
self.logger.error('Invalid config in (varken.ini): %s',e)
exit(1)
self.filtered_strings = None self.filtered_strings = None