hi and thanks for reading. im a newbie in programming and C# and sockets programming. in my code i try and catch problems to provide fault tolarence in my app. the following:
IMO:
Catching Exception
would be pretty similar to having methods with parameters that are never more specific of a class than Object
; Sure you can do it but is it really the best decision 9 out of 10 times?
What you should consider doing to simplify your code some is Catch exceptions at the highest definition that is relevant.
For instance, in java I would
try{...}
catch( IOException e ) {...}
to catch all IO related exceptions.
There are too many things that can throw too many different types of exceptions, you typically should avoid using the catch-all that is Exception
.