When Not to Show Error Dialogs
Tuesday, March 1, 2005
Imagine what happens if you pop up error messages in code that runs in a context like the following:
- Mouse events (MouseMove, especially).
- Keyboard events.
- Input-related change events (selection changes, text changes).
- Activation/Focus events.
- Layout/Resizing events.
- Painting events.
- Timer events.
- Anything done in a loop.
- Cleanup actions.
Instead, record the exception, and signal it to the user in the status bar. As for reporting, consider prompting the user at shutdown, or save all error info to disk, so it can be reported any time later.