Add a log entry to the debug log on config error

Recently a config problem broke gerritbot's ability to start, but what's
worse, there was no logging about why. Log the exception when this
happens.

Change-Id: If7832cbe5cbf5f506d5dfbb849f05f2e7670a2df
This commit is contained in:
Monty Taylor 2015-09-20 19:33:09 -04:00
parent 957981e7d8
commit f907ae7054
1 changed files with 6 additions and 1 deletions

View File

@ -308,7 +308,12 @@ def _main(config):
else:
raise Exception("Channel Config must be specified in config file.")
channel_config = ChannelConfig(yaml.load(open(fp)))
try:
channel_config = ChannelConfig(yaml.load(open(fp)))
except Exception:
log = logging.getLogger('gerritbot')
log.exception("Syntax error in chanel config file")
raise
bot = GerritBot(channel_config.channels,
config.get('ircbot', 'nick'),