issue #213: core: have Message.reply() log msg for zero reply_to

It's easy to call msg.reply() by accident on a message that never had
reply_to set, resulting in a "invalid handle" error message coming from
router. Instead log a more accurate message on the stack that actualy
caused the problem.
pull/255/head
David Wilson 6 years ago
parent 633585524f
commit 2310497d55

@ -380,7 +380,10 @@ class Message(object):
msg.dst_id = self.src_id
msg.handle = self.reply_to
vars(msg).update(kwargs)
(self.router or router).route(msg)
if msg.handle:
(self.router or router).route(msg)
else:
LOG.debug('Message.reply(): discarding due to zero handle: %r', msg)
def unpickle(self, throw=True, throw_dead=True):
"""Deserialize `data` into an object."""

Loading…
Cancel
Save