There's a clsException property that we add to Python exceptions that will give 
you the CLR Exception for the corresponding Python Exception.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Eloff
Sent: Tuesday, July 08, 2008 4:37 PM
To: Discussion of IronPython
Subject: [IronPython] How to get a System.Exception inside a IronPython except: 
clause

This may sound a little similar to some of my other posts on here, the
help I received previously has enabled me to get stuck in new and
exciting areas :)

The stdlib traceback module can be used to format python exceptions,
but unfortunately it seems to leave out some information, like clr
exception data (thanks Curt and Jimmy for helping me turn that on). So
now I find myself thinking how to use
Application.Current.Environment.GetEngine('py').FormatException()
(thanks Dino) to do a better job. The only trouble is it wants a clr
Exception, not a ValueError. Is there any way to call this function
with the tools available inside of an except: clause ?

Thanks,
-Dan
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to