Subclassing exceptions

Sue Giller sag at hydrosphere.com
Fri Jan 4 17:22:44 EST 2002


> why do you wanna do this?

Eventually, the exceptions will be passed back thru a COM object.  I 
want to be able to pass information on both the exception that was 
raised within Python, as well as information on where in my script 
this exception occured, but I don't want a full trace.

I hope to create a general COM error, subclassed for each of my 
COM objects, that can pass back this info.  So I need to handle the 
case where I have caught an exception, as well as the case where I 
just want to raise my own exception.

As further information, I can run my test script in DOS window and I 
get the correct results.  I haven't tested it yet in a com object, but 
that is next.  I build and test my scripts in PythonWin, so I tend to 
expect the behaviour shown there to be the same as the behavior I 
would see running the same script in DOS.  So, that is where my 
puzzlement is coming from.

Thanks

sue






More information about the Python-list mailing list