Sto incorporando IronPython 2.0 in C#. In IronPython, ho definito la mia eccezione con:Catching Ironpython Eccezione in C#
def foobarException(Exception):
pass
e sollevare da qualche parte con:
raise foobarException("This is the Exception Message")
Ora in C#, ho:
try
{
callIronPython();
}
catch (Exception e)
{
// How can I determine the name (foobarException) of the Exception
// that is thrown from IronPython?
// With e.Message, I get "This is the Exception Message"
}
Hai provato con un debugger? Dovresti vedere il tipo di eccezione o l'eccezione interna, o ovunque sia memorizzata l'effettiva eccezione python. – OregonGhost
sì, ho provato con un debugger, ma non sono riuscito a trovarlo. Il fatto è che ha funzionato con IronPython 1.1. Quando ricordo correttamente in e.Data ["PythonExceptionInfo"] c'era in realtà il file python exception.message. E in e.Message c'era il nome dell'eccezione. – foobar