Results 1 to 6 of 6

Thread: How to break only on UNHANDLED errors?

  1. #1

    Thread Starter
    Hyperactive Member wornways's Avatar
    Join Date
    Mar 2010
    Posts
    261

    How to break only on UNHANDLED errors?

    I can't figure out how to get VS to break only on unhandled errors. I've tried this checking the "User-unhandled" box and unchecking the "Thrown" box for "Common Language Run-time Exceptions" and I've tried checking both boxes, and I've tried checking only the "Thrown" box, and I've tried unchecking both boxes.

    VS either completely ignores all run-time exceptions or breaks on both handled and unhandled run-time exceptions. Is my VS 2008 IDE broken or am I missing something?
    Last edited by wornways; Mar 27th, 2010 at 04:32 AM.
    In an effort to abolish the writing of "Spaghetti Code",
    some fools got together and invented Spaghetti Syntax.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to break only on UNHANDLED errors?

    Sounds like something is broken because breaking on unhandled exceptions only is the default. Have you tried the "Reset All" button?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: How to break only on UNHANDLED errors?

    so you are saying if you put this in the form load:

    vb Code:
    1. try
    2. throw new exception("error")
    3. catch ex as exception
    4.  
    5. end try

    it breaks on the throw line in vs when you run it?/

    kris

  4. #4

    Thread Starter
    Hyperactive Member wornways's Avatar
    Join Date
    Mar 2010
    Posts
    261

    Re: How to break only on UNHANDLED errors?

    Quote Originally Posted by i00 View Post
    so you are saying if you put this in the form load:

    vb Code:
    1. try
    2. throw new exception("error")
    3. catch ex as exception
    4.  
    5. end try

    it breaks on the throw line in vs when you run it?/

    kris
    Yes, that's exactly what I'm saying. What happens is the form just loads and there is no indication that anything is wrong. You can even select widgets and do things.

    I did the Reset All, and now all exceptions are completely ignored. This is the case for both computers on which I have VS 2008 installed. I have no way to debug anything.

    I don't see subscript out of range errors, I don't see anything. The only way I can catch such errors is to break on ALL errors, and I only want to break on UNHANDLED errors.

    This is maddening. I can deal with all the strict protect-you-from-yourself syntax management, but I can't deal with not being able to debug one damned thing.
    In an effort to abolish the writing of "Spaghetti Code",
    some fools got together and invented Spaghetti Syntax.

  5. #5
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: How to break only on UNHANDLED errors?

    ahh ic what you mean ... this is only on the form initialization... and this p*ss*s me off too...

    happens in vista +

    and heres the cr*p thing:

    CODE THAT ERRORS WILL NOT BREAK IF IT IS RUN WHEN A FORM INITIALIZES

    it really s*x .... and it must be an os thing ... in windows xp it breaks

    have a look at this thread that i started ages ago:

    http://www.vbforums.com/showthread.php?t=582462

    Kris

  6. #6
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: How to break only on UNHANDLED errors?

    also i assume that it's because the form comes from the OS and in vista the logic behind the form is something like this when it loads:

    vb Code:
    1. Try
    2.     RaiseEvent Load(.....
    3. catch ex as exception
    4.     'do nothing :(
    5. end try

    Kris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width