c pound

I reject your reality and substitute my own!
posts - 46, comments - 37, trackbacks - 40

My Links

News

Archives

Image Galleries

Blog Communities

Blog is a stupid word

Lunch Hour

Resources

Another debugging tip

While on the subject of debugging, I should not neglect to mention my all-time favorite debugging trick. First, step back a second and think: have you ever encountered the following vile and worse than useless bit of code?

try
{
   
//some code...
}
catch(Exception)
{
}

I have. Here's the easy way to find these heinous little buggers. Burried within Visual Studio .Net and Visual Studio 2005 is the “Exceptions” dialog (menu: Debug / Exceptions). The one in 2005 is considerably more friendly, but the basic idea with both is that you can tell the debugger to break (just like a break-point) when an exception is about to be thrown. Brilliant. By default, you only get a break when an unhandled exception is thrown. The above code, of course, “handles” any exception and thus renders the default setting quite useless.

Print | posted on Friday, September 23, 2005 7:41 AM |

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: