From 857632c7629aa8d6aee388b5b8c4b63f7e6bd66f Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 9 Jun 2012 18:54:10 +0200 Subject: [PATCH] Fix commit c310d74a19ab5179ccca75b1cd455f5d8f8bbcd4 (no more 'Error: error' message on 'Missing capability' error). --- src/callbacks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/callbacks.py b/src/callbacks.py index 95ab6cc63..2db9c9874 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -251,6 +251,10 @@ class ArgumentError(Error): """The bot replies with a help message when this is raised.""" pass +class SilentError(Error): + """An error that we should not notify the user.""" + pass + class Tokenizer(object): # This will be used as a global environment to evaluate strings in. # Evaluation is, of course, necessary in order to allow escaped @@ -478,7 +482,7 @@ class RichReplyMethods(object): else: log.debug('Not sending capability error, ' 'supybot.reply.error.noCapability is False.') - raise Error, 'error' + raise SilentError else: log.warning('Denying %s for some unspecified capability ' '(or a default).', self.msg.prefix) @@ -1217,6 +1221,8 @@ class Commands(BasePlugin): self.callCommand(command, irc, msg, *args, **kwargs) finally: self.callingCommand = None + except SilentError: + pass except (getopt.GetoptError, ArgumentError), e: self.log.debug('Got %s, giving argument error.', utils.exnToString(e))