Skip to content

Commit

Permalink
Fix commit c310d74 (no more 'Error: error' message on 'Missing capabi…
Browse files Browse the repository at this point in the history
…lity' error).
  • Loading branch information
progval committed Jun 9, 2012
1 parent 9723e14 commit 857632c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -478,7 +482,7 @@ def errorNoCapability(self, capability, s='', **kwargs):
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)
Expand Down Expand Up @@ -1217,6 +1221,8 @@ def _callCommand(self, command, irc, msg, *args, **kwargs):
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))
Expand Down

0 comments on commit 857632c

Please sign in to comment.