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)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment