Related questions
Catch multiple exceptions at once?
It is discouraged to simply catch System.Exception. Instead, only the "known" exceptions should be caught.
Now, this sometimes leads to unneccessary repetitive code, for example:
try
{
WebId = new Guid(queryString["web"]);
}
catch (FormatException)
{
WebId = Guid.Empty;
}
catch (OverflowException)
{
WebId = …
How using try catch for exception handling is best practice
while maintaining my colleague's code from even someone who claims to be a senior developer, I often see the following code:
try
{
//do something
}
catch
{
//Do nothing
}
or sometimes they write logging information to log files like following try catch …
How to avoid a System.Runtime.InteropServices.COMException?
In my Microsoft Surface project, I always get a lot of the following exceptions:
'MuReSe.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'
'MuReSe.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\…