I have this consumer targeted application that has built in error reporting.
Sometimes I get error reports for exceptions like the remote name could not be resolved
on host names like google.com for example.
Which obviously is not a problem in my application, but rather on the users end.
How can I, in my application, categorize certain Exceptions and instead of offer sending an error report, show a dialog suggesting the user to check certain things on his/her end.
Also taking into account the fact that users have localized .NET framework installations. (Error messages in their language)
EDIT: It’s really not a question about separating SQLException from WebException, it’s more how I can determine a WebException of type remote name could not be resolved from WebException The operation has timed-out for example.
You want to use try/catch statement with multiple catch blocks:
Basically, each one of those exception should contain additional information in properties that you can check without relying on string comparisons.