diff --git a/tractor/_streaming.py b/tractor/_streaming.py index 86060b9..47fd08a 100644 --- a/tractor/_streaming.py +++ b/tractor/_streaming.py @@ -425,7 +425,17 @@ class Context: f'Remote context error for {self.chan.uid}:{self.cid}:\n' f'{msg["error"]["tb_str"]}' ) - self._error = unpack_error(msg, self.chan) + error = unpack_error(msg, self.chan) + if ( + isinstance(error, ContextCancelled) and + self._cancel_called + ): + # this is an expected cancel request response message + # and we don't need to raise it in scope since it will + # potentially override a real error + return + + self._error = error # TODO: tempted to **not** do this by-reraising in a # nursery and instead cancel a surrounding scope, detect