3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-03 16:39:25 +01:00

pylink: show a better error if the protocol module is missing

This commit is contained in:
James Lu 2016-07-28 21:33:13 -07:00
parent c36c32082f
commit 85e786904c

5
pylink
View File

@ -58,8 +58,11 @@ if __name__ == '__main__':
# Initialize all the networks one by one # Initialize all the networks one by one
for network, sdata in conf.conf['servers'].items(): for network, sdata in conf.conf['servers'].items():
try:
protoname = sdata['protocol'] protoname = sdata['protocol']
except (KeyError, TypeError):
log.error("(%s) Configuration error: No protocol module specified, aborting.", network)
else:
# Fetch the correct protocol module # Fetch the correct protocol module
proto = utils.getProtocolModule(protoname) proto = utils.getProtocolModule(protoname)
world.networkobjects[network] = irc = classes.Irc(network, proto, conf.conf) world.networkobjects[network] = irc = classes.Irc(network, proto, conf.conf)