service: fix SerializedInvoker CallError handling.

This cutpaste needs refactored. Ensure the caller receives a copy of the
exception.
This commit is contained in:
David Wilson 2018-06-10 15:26:14 +01:00
parent 45b748833d
commit 205052ed90
1 changed files with 5 additions and 2 deletions

View File

@ -271,9 +271,12 @@ class SerializedInvoker(Invoker):
method_name, kwargs, msg = tup method_name, kwargs, msg = tup
try: try:
super(SerializedInvoker, self).invoke(method_name, kwargs, msg) super(SerializedInvoker, self).invoke(method_name, kwargs, msg)
except mitogen.core.CallError:
e = sys.exc_info()[1]
LOG.warning('%r: call error: %s: %s', self, msg, e)
msg.reply(e)
except Exception: except Exception:
LOG.exception('%r: while invoking %r of %r', LOG.exception('%r: while invoking %s()', self, method_name)
self, method_name, self.service)
msg.reply(mitogen.core.Message.dead()) msg.reply(mitogen.core.Message.dead())
def invoke(self, method_name, kwargs, msg): def invoke(self, method_name, kwargs, msg):