You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now repr(exc) just gives Cancelled() which is not so helpful when trying to debug. Maybe something like <Cancelled, scope 3 in task some_func-3>?
(Even nicer if we could provide line numbers, but I think that would be expensive? Also misleading when the scope is hidden inside open_nursery or move_on_at.)
The text was updated successfully, but these errors were encountered:
Tasks have had names for a while, and Cancelled exceptions don't know what scope will catch them anymore, so I'm not sure there's anything left to be done here.
@oremanj I think this is still relevant, or at least deserves a new proposal. It's still true that Cancelled exceptions are a bit too anonymous when debugging, and adding extra context info would help "user happiness".
IMHO the way to fix this is to store the stack of the caller of the .cancel method so that the actual Cancelled exception can use it in a raise from or similar.
oremanj
changed the title
Give names to tasks and cancel scopes, and put the names in Cancelled exceptions
Make it easier to tell where a Cancelled exception came from
Mar 12, 2019
Right now
repr(exc)
just givesCancelled()
which is not so helpful when trying to debug. Maybe something like<Cancelled, scope 3 in task some_func-3>
?(Even nicer if we could provide line numbers, but I think that would be expensive? Also misleading when the scope is hidden inside
open_nursery
ormove_on_at
.)The text was updated successfully, but these errors were encountered: