For example, if I'm opening a file, I know a FileNotFoundException might happen, or if I'm converting a String to double, a FormatException may happen. Obviously, if a method does both, both can be raised.
Is there a way to quickly see all possible exceptions raised by a method though? Keeping track of it myself seems error prone.
It's not built into VS. There are 3rd party tools, though, like Redgate's exception hunter.
Edit I'm not employed by RG, but I am a fan of their products. I've tried this particular one, but we ended up not buying it.
If memory serves me correctly if the intellisense tool tip should have a list of exceptions the method can throw. You can also open a browser tab in visual studio pointing to MSDN like so: http://msdn.microsoft.com/en-us/library/b9skfh7s.aspx#ddueExceptionsToggle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With