It should be noted that if you catch an Exception (or just have a catch
statement) that your application won't necessarily be "stable". In catching
all exceptions (instead of just ones you know are going to be thrown) you
are corrupting your application state to some degree, and if you aren't
fastidious about defining the boundaries of your application, you will have
unexpected errors because of exceptions that were thrown and ignored in
other areas.
In other words, be very careful about proceeding in this manner. There
are reasons that exceptions are thrown, and you should ignore them at your
own peril.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"RP" <rp*********@gmail.comwrote in message
news:e7**********************************@e32g2000 prn.googlegroups.com...
In certain code blocks I don't want to do anything when an error is
raised. I simply want that application must remain stable instead of
crash. For the following code, is there a way to ignore declaration of
Exception ex:
try
{
//do somthing
}
catch (Exception ex)
{ //do nothing };
Since I am not using ex, it raises too many warnings.