What is exception chaining?
Exception handling
Audio flashcard · 0:15Nortren·
What is exception chaining?
0:15
When one exception is raised while handling another, Python links them via the dunder context attribute, showing both in the traceback. You can also use raise NewException from original to set dunder cause, indicating an explicit causal link. Chaining helps debugging by preserving context.
docs.python.org