Tips for exception handling:
1. Don't log the exception in each catch block in the method. I would recommend to log the exceptions at the manager level classes only to avoid flooding of log files.
2. General exception catch should be last catch block to avoid wrapping of known exceptions. (Note that, all exceptions are inherited from "Exception" class)
3. Propagate exceptions to up/top level for logging and handling.
Example:
try
{
}
catch (IOException ex)
{
Trace.TraceError("Message={0}\r\nStack={1}", ex.Message, ex.StackTrace);
throw;
}
catch (Exception ex)
{
Trace.TraceError("Message={0}\r\nStack={1}", ex.Message, ex.StackTrace);
throw;
}
finally
{
}