mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Made sure to catch exceptions in takeMsg.
This commit is contained in:
parent
68c4ca6895
commit
67db74e500
@ -83,7 +83,11 @@ class AsyncoreDriver(asynchat.async_chat, object):
|
||||
|
||||
def writable(self):
|
||||
while self.connected:
|
||||
m = self.irc.takeMsg()
|
||||
try:
|
||||
m = self.irc.takeMsg()
|
||||
except Exception, e:
|
||||
log.exception('Uncaught exception in irclib.Irc.takeMsg:')
|
||||
return
|
||||
if m:
|
||||
self.push(str(m))
|
||||
else:
|
||||
|
@ -75,7 +75,11 @@ class SocketDriver(drivers.IrcDriver):
|
||||
self.reconnect()
|
||||
|
||||
def _sendIfMsgs(self):
|
||||
msgs = [self.irc.takeMsg()]
|
||||
try:
|
||||
msgs = [self.irc.takeMsg()]
|
||||
except Exception, e:
|
||||
log.exception('Uncaught exception in irclib.Irc.takeMsg:')
|
||||
return
|
||||
while msgs[-1] is not None:
|
||||
msgs.append(self.irc.takeMsg())
|
||||
del msgs[-1]
|
||||
|
@ -69,7 +69,11 @@ class SupyIrcProtocol(LineReceiver):
|
||||
|
||||
def checkIrcForMsgs(self):
|
||||
if self.connected:
|
||||
msg = self.factory.irc.takeMsg()
|
||||
try:
|
||||
msg = self.factory.irc.takeMsg()
|
||||
except Exception, e:
|
||||
log.exception('Uncaught exception in irclib.Irc.takeMsg:')
|
||||
return
|
||||
if msg:
|
||||
self.transport.write(str(msg))
|
||||
self.mostRecentCall = reactor.callLater(1, self.checkIrcForMsgs)
|
||||
|
Loading…
Reference in New Issue
Block a user