Adjust lowlevel-tb hiding logic for `MsgStream`
Such that whenev the `self._ctx.chan._exc is trans_err` we suppress. I.e. when the `Channel._exc: Exception|None` error **is the same as** set by the `._rpc.process_messages()` loop (that is, set to the underlying transport layer error), we suppress the lowlevel tb, otherwise we deliver the full tb since likely something at the lowlevel that we aren't detecting changed/signalled/is-relevant!SDOF_pre_sin_testing_XPSBACKUP
parent
abdaf7bf1f
commit
a6fefcc2a8
|
@ -595,8 +595,17 @@ class MsgStream(trio.abc.Channel):
|
|||
trio.ClosedResourceError,
|
||||
trio.BrokenResourceError,
|
||||
BrokenPipeError,
|
||||
) as trans_err:
|
||||
if hide_tb:
|
||||
) as _trans_err:
|
||||
trans_err = _trans_err
|
||||
if (
|
||||
hide_tb
|
||||
and
|
||||
self._ctx.chan._exc is trans_err
|
||||
# ^XXX, IOW, only if the channel is marked errored
|
||||
# for the same reason as whatever its underlying
|
||||
# transport raised, do we keep the full low-level tb
|
||||
# suppressed from the user.
|
||||
):
|
||||
raise type(trans_err)(
|
||||
*trans_err.args
|
||||
) from trans_err
|
||||
|
|
Loading…
Reference in New Issue