I'm used to:
private void buttonFoo_Click() { try { foo(); } catch(ApplicationException ex) { Log.UserWarning(ex); MessageVox.Show(ex.Message); } catch(Exception ex) { Log.CodeError(ex); MessageBox.Show("Internal error."); } }
This allows you to make the difference between:
- C # system system error that I have to execute.
- A "normal" user error that does not need to be fixed by me.
I know that it is not recommended to use ApplicationException, but it works fine, because there are very few classes that do not respect the ApplicationException pattern.
Olivier de Rivoyre Jul 06 '09 at 12:07 2009-07-06 12:07
source share