Don't log discarded old protocol messages as ERROR

This commit is contained in:
Andrew Godwin 2017-04-04 10:51:07 +02:00
parent 382318b6d2
commit bd03fabce6

View File

@ -354,8 +354,13 @@ class HTTPFactory(http.HTTPFactory):
return self.reply_protocols.keys() return self.reply_protocols.keys()
def dispatch_reply(self, channel, message): def dispatch_reply(self, channel, message):
# If we don't know about the channel, ignore it (likely a channel we
# used to have that's now in a group).
# TODO: Find a better way of alerting people when this happens so
# they can do more cleanup, that's not an error.
if channel not in self.reply_protocols: if channel not in self.reply_protocols:
raise ValueError("Cannot dispatch message on channel %r (unknown)" % channel) logger.debug("Message on unknown channel %r - discarding" % channel)
return
if isinstance(self.reply_protocols[channel], WebRequest): if isinstance(self.reply_protocols[channel], WebRequest):
self.reply_protocols[channel].serverResponse(message) self.reply_protocols[channel].serverResponse(message)