From 205052ed9099c115052dbdb2a05a264dcef19fd0 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 10 Jun 2018 15:26:14 +0100 Subject: [PATCH] service: fix SerializedInvoker CallError handling. This cutpaste needs refactored. Ensure the caller receives a copy of the exception. --- mitogen/service.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mitogen/service.py b/mitogen/service.py index dd8ac5cb..ffb45649 100644 --- a/mitogen/service.py +++ b/mitogen/service.py @@ -271,9 +271,12 @@ class SerializedInvoker(Invoker): method_name, kwargs, msg = tup try: 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: - LOG.exception('%r: while invoking %r of %r', - self, method_name, self.service) + LOG.exception('%r: while invoking %s()', self, method_name) msg.reply(mitogen.core.Message.dead()) def invoke(self, method_name, kwargs, msg):