I know it isn't good practice to intentionally rely on exceptions in program flow. But there are times when it is necessary:
eg. There is no Json TryParse method that I can find that does not rely on an exception being used to return a false value.
How can I debug and break on all exceptions EXCEPT for these intended exceptions?
-- Edit (I'm still struggling with this) --
Let's say I use the code shown in the first answer: How to make sure that string is valid JSON using JSON.NET
Under some circumstances, the code will intentionally handle a JsonReaderException and return false.
When this occurs, I do NOT want the debugger to break on that line. However I do NOT want JsonReaderExceptions ignored elsewhere in my code.
Can I ignore the exception only in this one method?
--
I see that I can ignore an exception type across and entire assembly https://devblogs.microsoft.com/devops/break-on-exceptions-thrown-only-from-specific-modules-in-visual-studio-15-preview/
This approach isn't satisfactory, because I often work with COMExceptions, and there's no way that I would intentionally ignore all COMExceptions in an assembly.
I thought it would be possible to ignore an exception in a more fine grained manner. I expected to be able to decorate my method with an attribute that instructs the debugger to continue. Something similar to [System.Diagnostics.DebuggerStepThrough]