SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Siegfried Pammer

Customizing "Pause on handled exceptions" in SharpDevelop 5

Debugging exceptions in async methods can be quite difficult as exceptions are automatically caught and rethrown once the Task finishes executing. This leads to the problem that you end up with a stack trace missing important information about where and why the exception was thrown.

A possible solution to this is to simply let the debugger break on any exception that is thrown in your code, even if it's handled later on. Now, that's nothing new. The "Pause on handled exceptions" feature was introduced in SharpDevelop 4. The news is that you can choose which exceptions you want to break on and which you want to ignore:

You can add any exception you either want to break on or want to ignore. The example shown above simply means: Break on any exception derived from System.Exception, that is, every exception except System.OperationCanceledException (and any exceptions derived from OperationCanceledException).

But, if you don't want to enter all the exceptions manually, you can ignore them while debugging a program:

Just uncheck the box and click continue. The debugger will never break on a handled exception of that type again. Of course, you can re-enable ignored exceptions by editing the list at any time.


No Comments
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this ( email address.