How can I make VS break on exceptions in an async Task, without breaking on all exceptions?

A) Wrap your calls and throw a custom Exception in your Task code. Break on only throw of your custom exception. You can select the Exceptions for first throw.

B). Debug.Assert() your Task Results, if you have any wait code. i.e., not just firing and forgetting. Tasks return the Exceptions in a property if you wait on them somewhere or stick error handling in a continuation.

psuedo code
i.e. task. continuewith(r => if(!r.Exception is null) Debug.Break()))
etc.

Hope that helps you on the right path.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)