Unit content
Error prevention, recovery and undo
Good interfaces reduce the chance of errors and make recoverable mistakes cheap.
Prevention is preferable when the system already knows an action is invalid. Constraints, sensible defaults, input validation and clearly distinguished destructive actions can stop many errors before they occur.
When an action is valid but risky, a confirmation can be useful if the consequence is difficult to reverse. Confirming every routine action, however, trains users to dismiss warnings without reading them.
Whenever practical, provide undo or another reversible path instead of relying only on warnings. Reversibility lets users explore with less fear and turns some severe mistakes into ordinary corrections.
Error messages should state what happened, what remains unchanged and what the user can do next. Internal error codes alone rarely provide that guidance.
Design for recovery assumes that errors will occur and ensures they do not unnecessarily become data loss, dead ends or hidden inconsistent state.