Exceptions within the .NET frame work should be caught from most specific to least specific. This is because only the first catch block with a matching exception type is the only block that is executed. So in other words if you catch a more general exception before a less general exception, the code will never make it beyond the general exception that is caught. The more specific catch block becomes unreachable code.
Additional Resources
.NET Exception Handling (Microsoft)
Showing posts with label least specific to most specific or vice versa?. Show all posts
Showing posts with label least specific to most specific or vice versa?. Show all posts
Subscribe to:
Posts (Atom)