Log context cancellation using `.cancel()` loglevel
parent
3483151aa8
commit
3f09843951
|
@ -431,19 +431,24 @@ class Context:
|
||||||
# (currently) that other portal APIs (``Portal.run()``,
|
# (currently) that other portal APIs (``Portal.run()``,
|
||||||
# ``.run_in_actor()``) do their own error checking at the point
|
# ``.run_in_actor()``) do their own error checking at the point
|
||||||
# of the call and result processing.
|
# of the call and result processing.
|
||||||
log.error(
|
error = unpack_error(msg, self.chan)
|
||||||
|
if (
|
||||||
|
isinstance(error, ContextCancelled)
|
||||||
|
):
|
||||||
|
log.cancel(
|
||||||
f'Remote context error for {self.chan.uid}:{self.cid}:\n'
|
f'Remote context error for {self.chan.uid}:{self.cid}:\n'
|
||||||
f'{msg["error"]["tb_str"]}'
|
f'{msg["error"]["tb_str"]}'
|
||||||
)
|
)
|
||||||
error = unpack_error(msg, self.chan)
|
if self._cancel_called:
|
||||||
if (
|
|
||||||
isinstance(error, ContextCancelled) and
|
|
||||||
self._cancel_called
|
|
||||||
):
|
|
||||||
# this is an expected cancel request response message
|
# this is an expected cancel request response message
|
||||||
# and we don't need to raise it in scope since it will
|
# and we don't need to raise it in scope since it will
|
||||||
# potentially override a real error
|
# potentially override a real error
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
log.error(
|
||||||
|
f'Remote context error for {self.chan.uid}:{self.cid}:\n'
|
||||||
|
f'{msg["error"]["tb_str"]}'
|
||||||
|
)
|
||||||
|
|
||||||
self._error = error
|
self._error = error
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue