Fixed a bug in errorInvalid's handling of Raise. Man, we just need to default it to True for everything and make people deal.

This commit is contained in:
Jeremy Fincher 2004-09-28 08:12:03 +00:00
parent 201df375e2
commit f9ae666f3b

View File

@ -503,14 +503,16 @@ class RichReplyMethods(object):
v = '%s is not a valid %s.' % (given, what) v = '%s is not a valid %s.' % (given, what)
else: else:
v = 'That\'s not a valid %s.' % what v = 'That\'s not a valid %s.' % what
return self._error(self.__makeReply(v, s), Raise=True, **kwargs) if 'Raise' not in kwargs:
kwargs['Raise'] = True
return self._error(self.__makeReply(v, s), **kwargs)
_repr = repr _repr = repr
class IrcObjectProxy(RichReplyMethods): class IrcObjectProxy(RichReplyMethods):
"A proxy object to allow proper nested of commands (even threaded ones)." "A proxy object to allow proper nested of commands (even threaded ones)."
def __init__(self, irc, msg, args, nested=0): def __init__(self, irc, msg, args, nested=0):
log.debug('IrcObjectProxy.__init__: %s' % args) log.verbose('IrcObjectProxy.__init__: %s' % args)
self.irc = irc self.irc = irc
self.msg = msg self.msg = msg
self.nested = nested self.nested = nested
@ -566,13 +568,13 @@ class IrcObjectProxy(RichReplyMethods):
self.finalEval() self.finalEval()
def _callTokenizedCommands(self): def _callTokenizedCommands(self):
log.debug('Calling tokenizedCommands.') log.verbose('Calling tokenizedCommands.')
for cb in self.irc.callbacks: for cb in self.irc.callbacks:
if hasattr(cb, 'tokenizedCommand'): if hasattr(cb, 'tokenizedCommand'):
log.debug('Trying to call %s.tokenizedCommand.' % cb.name()) log.verbose('Trying to call %s.tokenizedCommand.', cb.name())
self._callTokenizedCommand(cb) self._callTokenizedCommand(cb)
if self.msg.repliedTo: if self.msg.repliedTo:
log.debug('Done calling tokenizedCommands: %s.' % cb.name()) log.verbose('Done calling tokenizedCommands: %s.',cb.name())
return return
def _callTokenizedCommand(self, cb): def _callTokenizedCommand(self, cb):
@ -608,6 +610,8 @@ class IrcObjectProxy(RichReplyMethods):
self.commandMethod = cb.getCommand(name) self.commandMethod = cb.getCommand(name)
try: try:
cb.callCommand(name, self, self.msg, self.args) cb.callCommand(name, self, self.msg, self.args)
except Error, e:
self.error(str(e))
except Exception, e: except Exception, e:
cb.log.exception('Uncaught exception in %s.%s:', cb.log.exception('Uncaught exception in %s.%s:',
cb.name(), name) cb.name(), name)