I read a lot about how bad catching base Exceptions is and I have to confess that I did it also:
try{
...
}
catch (Exception exception){
MessageBox.Show(exception.Message, "Error!");
MyLogger.Log(exception.Message);
}
Now I would like to do it right and have some questions about it:
- Which exceptions should I catch (for example FileNotExists for file manipulation, but what for TableAdapter or ReportClass (CrystalReports))
- Where can I see a list of exceptions, that an objects can throw (for example TableAdapter)
- Where in Windows Forms Application can I set a static method, which will log any exception to a file for example
- Any other suggestions?
Thanks!