0

I'm wanting to determine at run-time if an exception class has been specifically ignored in the IDE. The reason is this: When running an application from the IDE I might receive an exception that I know the reason for, but don't want to deal with right now. So I check the "Ignore these exceptions" box and click continue.

Its possible that I might forget to disable this setting later, so I want to add code at the startup of the application to warn me that exceptions in the list at Tools/Options/Debugger Options/CodeGear Debuggers/Language Exceptions are being ignored.

An alternative would be a fragment of code that could determine the status of an exception class (i.e. whether ignored or not) without triggering the exception in the IDE.

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
rossmcm
  • 5,493
  • 10
  • 55
  • 118
  • Why should the application bother if the IDE is not showing up an exception? The application gets the exception anyway – Sir Rufo Dec 21 '14 at 22:53
  • Read it out of the registry. It will be under `HKCU\Software`. An IDE expert might make sense. But code in the app is surely wrong. – David Heffernan Dec 21 '14 at 22:53
  • What if your process is being debugger under WinDbg instead of RAD Studio? – Free Consulting Dec 22 '14 at 07:30
  • Whoooooaah. Why the downvote? Here's the scenario: I have an app that does a web access when it start up. If the web isn't available for some reason, the web access fails, causing an exception. My app handles this exception, but the IDE still coughs on it. So I tell the debugger to ignore these exceptions, because when I'm debugging without web access, its annoying. I just wanted some way of reminding myself when running under the debugger that I had previously set it to ignore exceptions. – rossmcm Dec 22 '14 at 09:30
  • @rossmcm, the downvote is from me. Because your desired solution more likely to pose ambiguities than to solve a base problem, namely: a lack per project/configuration debugger settings. – Free Consulting Dec 22 '14 at 16:49
  • 2
    My preferred way for dealing with this can be found in [this answer](http://stackoverflow.com/a/16226384), which is much easier and more flexible than either your current method or the method you're trying to find IMO. – Ken White Dec 24 '14 at 13:37
  • @Free I don't see how per project/configuration debugger settings would change things. I would still have had the issue within a project configuration -viz. forgetting that I was running with an exception class 'globally' suppressed. However, Ken White's [solution](http://stackoverflow.com/a/16226384) fits the bill nicely. – rossmcm Dec 24 '14 at 21:56
  • It wasn't clear from your original question what you'd like to disable "Break on [any] exception" behaviour on code block basis as per @Ken's solution and ofc it doesn't reminds you to revert unless you browse breakpoint list. – Free Consulting Dec 24 '14 at 23:14
  • @Free: Checking the "ignore this exception type" doesn't remind you to revert, either. Breakpoints are clearly visible in the Code Editor and breakpoints list; disabled exceptions are not visible without wading through a couple of dialogs. – Ken White Dec 24 '14 at 23:17
  • @KenWhite, very likely, if you are looking directly to the block with such pair of breakpoints. Otherwise you have to visit breakpoint properties dialog and probably also expand advanced properties to locate such block. – Free Consulting Dec 24 '14 at 23:26
  • @Free: But there's a hotkey for viewing the breakpoint list (Ctrl+Alt+B). There's no such shortcut for getting to the ignored exceptions dialog. A right-click on the breakpoint allows you to access the properties dialog or enable/disable the breakpoint. Scope of the effect of the breakpoint is also as wide or as narrow as you want, while the ignored exceptions dialog is always widely scoped. – Ken White Dec 24 '14 at 23:30

2 Answers2

5

If you don't want to deal with exceptions in the IDE set breakpoints around the point where they occur. Then edit the breakpoints:

For the first one set its advanced properties to not Break on exception and to Ignore subsequent exceptions.

For the second one set its advanced properties to not Break on exception and to Handle subsequent exceptions.


You have to take care to not throw away those breakpoints (e.g. using Delete all breakpoints), and occassionally they lose their proper place in the editor. It's also difficult to share these with other developers if you work with source control.

Community
  • 1
  • 1
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
3

The application being debugged doesn't have access to the debugger's list of ignored exceptions. Unless you figure out where and how the debugger stores that configuration and read/decypher it manually.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770