Can I take a break from Visual Studio on a C ++ custom exception?

I have an application that throws a lot of (handled) exceptions. In particular, there is one type of exception that I would like to break.

Is it possible to disable the debugger for a specific user exception? I do not understand why this is not possible, since he knows the type of exception thrown.

I can get around this by setting a breakpoint in the exception constructor, but it would be nice to know how to do this in the β€œright” way.

+4
source share
3 answers

If you go to the Debug menu and select Exceptions... (or press Ctrl+Alt+E ), you will get a dialog:

exceptions dialog

You need to click the Add... button, enter your own type name and make sure that the checkbox for your new exception type is checked.

+6
source

Try Debug menu > Exceptions > Add

+1
source

Yes, just use the __debugbreak function

0
source

Source: https://habr.com/ru/post/1270584/


All Articles