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
During benchmark testing with formatter I found out that C# has an issue with catching exceptions thrown by a callback. I reduced my code down to a basic example:
So, MethodBase.Invoke wraps thrown exception in a TargetInvokationException, so we should do try method.Invoke(...) catch (e:TargetInvokationException) throw e.InnerException.
The problem is how to preserve stack trace without horrible hacks. With .NET 4.5 we can do ExceptionDispatchInfo.Capture(ex.InnerException).Throw(), but before that....
In general we should rework how method closures are created in C#, these should not go through reflection. I had a branch with the rework a couple years ago but never got it to work 100% due to some problems with access control.
During benchmark testing with formatter I found out that C# has an issue with catching exceptions thrown by a callback. I reduced my code down to a basic example:
expected output: "my exception caught"
C# output: "unhandled exception" + stacktrace
broken for both Haxe 3 and 4
The text was updated successfully, but these errors were encountered: