if System.Exception does not catch exceptions of type System.Net.WebException.
System.Exception
will catch the WebException
since System.Exception
is a base class.
I do not want separate code for different exceptions. Just one message box stating "error occurred" is good enough for me for all types of exceptions.
In that particular case even an empty catch block would be enough (apart from catching in System.Exception). But generally it is not considered a good practice.
try
{
Webservice.Method();
}
catch
{
// Show error
}
You may see: Best Practices for Exceptions