the difference between recoverable errors and bugs:
• A recoverable error is usually the result of programmatic data validation. Some code has examined the state of the world and deemed the situation unacceptable for progress. Maybe it’s some markup text being parsed, user input from a website, or a transient network connection failure. In these cases, programs are expected to recover. The developer who wrote this code must think about what to do in the event of failure because it will happen in well-constructed programs no matter what you do. The response might be to communicate the situation to an end-user, retry, or abandon the operation entirely, however it is a predictable and, frequently, planned situation, despite being called an “error.”
• A bug is a kind of error the programmer didn’t expect. Inputs weren’t validated correctly, logic was written wrong, or any host of problems have arisen. Such problems often aren’t even detected promptly; it takes a while until “secondary effects” are observed indirectly, at which point significant damage to the program’s state might have occurred. Because the developer didn’t expect this to happen, all bets are off. All data structures reachable by this code are now suspect. And because these problems aren’t necessarily detected promptly, in fact, a whole lot more is suspect. Depending on the isolation guarantees of your language, perhaps the entire process is tainted.
This distinction is paramount. Surprisingly, most systems don’t make one, at least not in a principled way! Runtime errors must be handled by the program. Bugs can only be handled by the programmer and must be abandoned by the program.
The Error Model
- If you *already know there’s an error* , a weaker test can be more ...from Hillel Wayne
- Dealing with Error: • Put the knowledge required to operate the te...from Don Norman
- Poka-yoke is another Japanese method, this one invented by Shigeo S...from Don Norman
- Errors have two major forms. Slips occur when the goal is correct, ...from Don Norman
- Although we generally prefer tolerating faults over preventing faul...from Martin Kleppmann
- The things that can go wrong are called faults, and systems that an...from Martin Kleppmann