I've been thinking about how things can go wrong lately.
At Cooper, we have a design principle that suggests that designers should "hide the ejector seat levers," meaning: make sure users can't inadvertently cause their software to fail. By the same token, we also encourage designers to "make errors impossible" by designing software that anticipates the actions of its users.
Nevertheless, things will go wrong. By anticipating failures, and designing backup plans like those described below, you can minimize the impact of unexpected problems on the user.