"catch(System.Exception e)"
will catch *all* .NET exceptions.
simply "catch" will also catch exceptions not based on System.Exception,
that is not CLS compliant exceptions which could be thrown by native code or
managed c++.
If you do not need a reference to the exception use
"catch(System.Exception)".
But you always should only catch the most specific exception which you are
expecting for example FormatException when you are parsing something and so
on, this makes sure you are not swallowing heavy bugs.
"John" <Jo**@discussions.microsoft.com> schrieb im Newsbeitrag
news:D2**********************************@microsof t.com...
Hello I know this is extremely basic, I just want to make sure I got it
right.
is:
try{}
catch{}
the same as
try{}
catch(System.Exception e){}
I mean if I am not using the reference to the exception then I should
simply use
catch{} ? or is catch(System.Exception){} somehow more restricted on what
it catches than simply catch{}?
Thanks in advance
JT.