Is there way to get to the code line which is throwing Arithmetic Exception like Infinity and NaN in VB.net

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Is there way to get to the code line which is throwing Arithmetic Exception like Infinity and NaN in VB.net



Is there anything to find in visual studio 2010, vb.net to find where Infinity and NaN are being thrown. I am looking into code by others and there is number of lines of codes and loop is long to track where Infinity and NaN exists since there exists lots of loop inside a single function.



I tried Debug->Exceptions->Common Language Runtime Exceptions=>System=>System.ArithmeticException and checking Thrown
This do not break the execution.





Those mishaps do not cause an exception. So no, you have to single-step the code to see it go wrong. Focus on getting good test data so you can consistently repro the problem and setting the right breakpoint so you don't have to step too much.
– Hans Passant
Aug 12 at 9:35





2 Answers
2



You can add a condition to a debug breakpoint, such as a check for Double.IsPositiveInfinity(x).



Set a breakpoint. Right-click it and choose "Conditions..." and set an appropriate condition.



More information: How to: Specify a Breakpoint Condition.



So one way I use to locate sometimes an error is to use debug.print() statements. So debug.print("1") and than some code and than debug.print("2"). I the second one doesn't print you know the error is in between the two debugs.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Z fF8jP4L qMVw sr
mkrEd qZjF1 8oZZ0o91JaJbWo3R7UkoaXqfZazjJiolqt,C7seYZ6FZMlwrt8a15iN3Yg whyTDoK2J

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3