From d4da80c55854cfa94f5c6e6e0ff1639f43ac3cea Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 16 Aug 2018 00:21:00 -0400 Subject: [PATCH] Store remote errors on each portal --- tractor/_portal.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tractor/_portal.py b/tractor/_portal.py index 04fa0a0..169249a 100644 --- a/tractor/_portal.py +++ b/tractor/_portal.py @@ -57,8 +57,8 @@ class Portal: # it is expected that ``result()`` will be awaited at some point # during the portal's lifetime self._result = None + self._exc = None self._expect_result = None - self._errored = False async def aclose(self): log.debug(f"Closing {self}") @@ -139,8 +139,9 @@ class Portal: try: return msg['return'] except KeyError: - raise RemoteActorError( + self._exc = RemoteActorError( f"{self.channel.uid}\n" + msg['error']) + raise self._exc else: raise ValueError(f"Unknown msg response type: {first_msg}")