Added a little extra error catching in irclib.Irc.takeMsg.

This commit is contained in:
Jeremy Fincher 2004-01-21 15:50:38 +00:00
parent 19e9d86a7c
commit 03e3ad47a0

View File

@ -524,7 +524,14 @@ class Irc(IrcCommandDispatcher):
# matter. That's why we gotta go munging in private attributes # matter. That's why we gotta go munging in private attributes
msg._str = msg._str[:500] + '\r\n' msg._str = msg._str[:500] + '\r\n'
msg._len = len(str(msg)) msg._len = len(str(msg))
try:
self.state.addMsg(self, msg) self.state.addMsg(self, msg)
except Exception, e:
log.exception('Uncaught exception in IrcState.addMsg. This '
'could be a bug, but it could also be the '
'result of an invalid message being sent via '
'Owner.ircquote.')
return
log.debug('Outgoing message: ' + str(msg).rstrip('\r\n')) log.debug('Outgoing message: ' + str(msg).rstrip('\r\n'))
return msg return msg
else: else: