What are the best practices to consider when catching exceptions, and re-throwing them. I want to make sure that the Exception object's InnerException and stack trace are preserved. Is there a difference between the following code blocks in how they handle this?
try
{
//some code
}
catch (Exception ex)
{
throw ex;
}
//......
try
{
//some code
}
catch
{
throw;
}