[Python-Dev] PEP-317

Brett C. drifty@alum.berkeley.edu
Mon, 09 Jun 2003 12:41:42 -0700

Greg Ewing wrote:
>>can we now consider implementing chained exceptions as 
>>has been mentioned here numerous times?
> I must have missed that. What are chained exceptions?

It was brought up once that raising an exception after another exception 
was already raised (because of an error in the exception-handling code, 
raising another exception to change the meaning) causes the original 
exception to be ignored.  It was suggested to keep a reference to the 
previous exception in the current exception so you could know about all 
the exceptions that have been raised.

Implementation could be easy as adding an attribute to store a reference 
to any previous exception that someone can look at if they care to. 
Obviously the reference would be set automatically when an exception is 
raised and an exception is already pending.

I think the open question was whether 'except' clauses should also check 
the previous exceptions or only the current one.

This was discussed on the list between Ping and I think Walter (could be 
wrong about Walter but I know Ping was involved).  Should be in the 
Summary archive somewhere; just need to find it.  =)