Is catch(Exception) recommended to be used in .NET?.NET has a very strong exception handling using try..catch blocks. Catch block is used to catch an exception and handle it as needed.
However usage of catch(Exception) is not recommended for various reasons. They are listed below: Catch(Exception)
is a general way of catching exceptions. All the exceptions will be caught
under this catch block and therefore it will be difficult to trap what
the actual exception is. You should always use more specific exceptions
like StackOverflowException, OutofMemoryException so that you will know
more details about the problem.
FREE
Subscription
Subscribe
to our mailing list and receive new articles Note
: We never rent, trade, or sell my email lists to Visit
.NET Programming Tutorial Homepage ______________________________________________________ |