Our error-reporting story is tolerable at this point (see #49 for some history), but could definitely still be improved. This collects some misc ideas:
@asynccontextmanager
and @async_generator
to reduce extraneous framesError.unwrap
) and out (_task_finished
) of tasks, update a record like exc.__trio_task_context__
with entries like (len(tb), "exit", task)
, and use them to add context to printed tracebacks. (The need to compute len
is a bit unfortunate though... I guess ideally these should be attributes on the tb objects themselves? But tb objects don't have __dict__
s. Or we could just stash the tb object.) MultiError.filter
needs to be careful to propagate these correctly when propagating tracebacks.MultiError.catch
is OK, but could be better
__context__
on MultiError
stry: raise exc except: ...
thing, then they get corrupt tracebacks (we assume that the filter callback doesn't touch the traceback). We could potentially detect new tb frames appearing and fix them up.MultiError
s and use our regular MultiError
printing code. This is good b/c it gives full information, but bad b/c it loses out on IPython's enhanced exception formatting. Better ergonomics for working with MultiErrors #49 has some notes on how this might be possible to get both. (Note that this becomes more of an issue if we do as suggested above and start customizing all exception output and not just MultiError
!) Possibly should chat with the IPython devs about this.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4