I guess there is no difference between these three parts of code, is not it?
try
{
// .............
}
catch
{
// .............
}
and
try
{
// .............
}
catch(Exception)
{
// .............
}
and
try
{
// .............
}
catch(Exception e)
{
// .............
}
However I am almost savvy when should be used the first one and when – the second. But I would like you to tell your ideas.
The first one will also catch thrown objects that aren’t exceptions.
(this can happen from non-CLS-compliant code)
The second one will not give a compiler warning if you don’t actually use the exception variable.
The third one should be used only if you actually need to inspect the thrown exception (eg, to log it).