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
How does exception handling work? We need to define the meaning of ignore, raise defer, and raise immediately in these cases. The easiest thing to do is make ignore completely ignore, and the others meaning we cancel all entered contexts and then raise
How do we handle contextbacks that swallow exceptions? It sounds dangerous to just allow it, because it will hurt other registrations on the way
The result of the yield statement, as well as what it yields, will have no semantics whatsoever -- any information passed to or from the contextbacks will be done solely via arguments
Provides/needs in the define phase, will hold only for the begin phase of the contextback
Attempting to call wait_for after the context has been entered, needs to result in a RuntimeError
Intuitively, the exception policies should apply for the enter phase, as once an enter is completed successfully, the exit must be called anyway for consistency. This means that exit can be thought of as always being "raise deferred".
We can also deceide that the cleanup exception priority is also dictated from the exception policy:
If the policy is ignore, we ignore exceptions in the handler exits completely
A raise immediately policy raises the latest handler exception immediately, meaning exceptions mask one another
A raise defer policy raises the first available exceptions, including the wrapped operation's exception
The policy defaults might be different between regular hooks and contextbacks
The usage should be something like:
And then for registration
The text was updated successfully, but these errors were encountered: