You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a type in my .NET Framework library with a static constructor that when I'm using from python.NET, apparently throws an exception. Ultimately, the exception manifests in the FieldObject.cs file for the python.net library in the tp_descr_get function where an attempt to call info.GetValue(null) raises a System.Reflection.TargetInvocationException. That exception is immediately caught and a call to Exceptions.SetError(Exceptions.TypeError, e.Message) is made. Unfortunately, all the valuable information in inner exceptions and stack trace are lost. Only e.Message is retained which always just says that an exception has been thrown by the target of an invocation.
It would be valuable if I could somehow get that information. Is there a way? Wouldn't it be valuable in general to be extracting all that information rather than just the message whenever handling an exception? Or at least to provide a means of doing it?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a type in my .NET Framework library with a static constructor that when I'm using from python.NET, apparently throws an exception. Ultimately, the exception manifests in the FieldObject.cs file for the python.net library in the tp_descr_get function where an attempt to call info.GetValue(null) raises a System.Reflection.TargetInvocationException. That exception is immediately caught and a call to Exceptions.SetError(Exceptions.TypeError, e.Message) is made. Unfortunately, all the valuable information in inner exceptions and stack trace are lost. Only e.Message is retained which always just says that an exception has been thrown by the target of an invocation.
It would be valuable if I could somehow get that information. Is there a way? Wouldn't it be valuable in general to be extracting all that information rather than just the message whenever handling an exception? Or at least to provide a means of doing it?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions