Debugger break location with F# exception handling -
I came in this situation and wanted to check whether I had a misconception about F # exceptions. I am using Visual Studio 2012. Looking at the following F # code:
main RGB = run (system.exeilation expression ("Foo")) increase printfn "here" (system.exeilation expression ("FU")) printfn With "do not go here here". : System.FormatException - & gt; Printfn "should not be here"
this will increase and AccessViolationException should not be made with because
with
only handles the system is. Format exception I hope the debugger is the first exception to raise
, but it is actually with
:
The problem is now that I do not know where the exception was raised, I can also do exceptions I do not see any information about Stacktrays, I do not think I want to change exception settings for personal exceptions because I Mr. I also want to know the location of unused exceptions (such as C #
or VB.NET
). ) When not thrown.
If this is the only way, then it is fine, but I just want to ask because I am not familiar with F #
and I have to make sure that I remember something No, I was watching online and found nothing about it.
Unless you want to modify the exception settings, then throw that exception type (or the exception To break a category of exceptions in settings), you have to make sure that your code takes care of exceptions, though it is best suited for your code.
with increase (System.AccessViolationException ("foo")). : System.FormatException - & gt; Printfn "should not be here" | _ As pre - & gt; #if DEBUG System.Diagnostics.Debugger.Break (); #else printfn "unmanaged exception ('% s'): '% s'" (ex.GetType (.name) ex.message #endif
Comments
Post a Comment