From 6e1704a6dda4c250c1e080721b7c61dd81be7d3e Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 17 Nov 2003 06:28:58 +0000 Subject: [PATCH] Needed to catch the possible KeyErrors in config. --- src/plugins.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/plugins.py b/src/plugins.py index 776e2ca28..3558ad445 100644 --- a/src/plugins.py +++ b/src/plugins.py @@ -356,16 +356,20 @@ class Configurable(object): if not name: irc.reply(msg, utils.commaAndify(self.configurables.names())) return - if not value: - help = self.configurables.help(name) - value = self.configurables.get(name, channel=channel) - irc.reply(msg, '%s: %s (Current value: %r)' % (name, help, value)) - return try: - self.configurables.set(name, value, channel) - irc.reply(msg, conf.replySuccess) - except ConfigurableTypeError, e: - irc.error(msg, str(e)) + if not value: + help = self.configurables.help(name) + value = self.configurables.get(name, channel=channel) + s = '%s: %s (Current value: %r)' % (name, help, value) + irc.reply(msg, s) + return + try: + self.configurables.set(name, value, channel) + irc.reply(msg, conf.replySuccess) + except ConfigurableTypeError, e: + irc.error(msg, str(e)) + except KeyError: + irc.error(msg, 'There is no config variable %r' % name) _randomnickRe = re.compile(r'\$randomnick', re.I)