mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Added error handling for a bad default network.
This commit is contained in:
parent
9bfb616623
commit
5f1a08f6e0
@ -206,7 +206,16 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# We could add an option for this, but we'll wait until it's requested.
|
# We could add an option for this, but we'll wait until it's requested.
|
||||||
defaultNetwork = conf.supybot.networks.default()
|
defaultNetwork = conf.supybot.networks.default()
|
||||||
|
try:
|
||||||
network = conf.supybot.networks.get(defaultNetwork)
|
network = conf.supybot.networks.get(defaultNetwork)
|
||||||
|
except registry.NonExistentRegistryEntry:
|
||||||
|
sys.stderr.write('No default network defined. Add a line to your ')
|
||||||
|
sys.stderr.write('registry that says (without the quotes), "supybot.')
|
||||||
|
sys.stderr.write('networks.default: <name>" where <name> is the name ')
|
||||||
|
sys.stderr.write('of the network you\'d like to connect to by ')
|
||||||
|
sys.stderr.write('default when the bot starts.')
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
server = network.server()
|
server = network.server()
|
||||||
if ':' in server:
|
if ':' in server:
|
||||||
serverAndPort = server.split(':', 1)
|
serverAndPort = server.split(':', 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user