tractor/tractor/trionics
Tyler Goodlet 86346c27e8 Extend `._taskc.maybe_raise_from_masking_exc()`
To handle captured non-egs (when the now optional `tn` isn't provided)
as well as yield up a `BoxedMaybeException` which contains any detected
and un-masked `exc_ctx` as its `.value`.

Also add some additional tooling,
- a `raise_unmasked: bool` toggle for when the caller just wants to
  report the masked exc and not raise-it-in-place of the masker.
- `extra_note: str` which by default is tuned to the default
  `unmask_from = (trio.Cancelled,)` but which can be used to deliver
  custom exception msg content.
- `always_warn_on: tuple[BaseException]` which will always emit
  a warning log of what would have been the raised-in-place-of
  `ctx_exc`'s msg for special cases where you want to report
  a masking case that might not be otherwise noticed by the runtime
  (cough like a `Cancelled` masking another `Cancelled) but which
  you'd still like to warn the caller about.
- factor out the masked-`ext_ctx` predicate logic into
  a `find_masked_excs()` and also use it for non-eg cases.

Still maybe todo?
- rewrapping multiple masked sub-excs in an eg back into an eg? left in
  #TODOs and a pause-point where applicable.
2025-06-15 18:28:20 -04:00
..
__init__.py Mv `maybe_raise_from_masking_exc()` to `.trionics` 2025-06-15 13:29:34 -04:00
_beg.py Add some tooling params to `collapse_eg()` 2025-06-13 22:06:55 -04:00
_broadcast.py A couple more loose-egs flag flips 2025-03-27 13:38:47 -04:00
_mngrs.py Move `.is_multi_cancelled()` to `.trioniics._beg` 2025-06-12 23:16:29 -04:00
_taskc.py Extend `._taskc.maybe_raise_from_masking_exc()` 2025-06-15 18:28:20 -04:00