A programmer error is a defect inside the code: incorrect logic, invalid assumptions, or broken invariants make an operation behave incorrectly or fail. Unlike technical problems, it requires correction in the code rather than routine recovery at runtime. section 7.1.3 section 7.1.4
Common manifestations include:
- Java IllegalArgumentException, ArithmeticException, ArrayIndexOutOfBoundsException, and ClassCastException. section 7.1.3
- C# InvalidOperationException and ArgumentException, or Python TypeError, ValueError, and IndexError. section 7.1.3
- Some programming mistakes escalate into fatal errors, such as OutOfMemoryError or StackOverflowError, where the failing process cannot recover normally. section 7.1.4
Unchecked exceptions are intentionally not permanent recovery cases. Detect them through thorough manual or automated testing, then fix the underlying defect directly. Catching them generically can conceal the failure instead of correcting it. section 7.1.3 section 7.3
Table 7.1 Summary of failure types and handling strategies
|
Type of failure
|
Description
|
|---|---|
|
Business logic errors
|
Violations of business rules or expected usage constraints that the system must anticipate and communicate clearly
|
|
Technical problems
|
Failures caused by external systems, infrastructure, configuration, or unavailable technical dependencies
|
|
Programming errors
|
Defects in the code itself caused by incorrect logic, invalid assumptions, or broken invariants
|
|
Fatal errors
|
Critical runtime failures that compromise process stability and usually prevent normal recovery
|
Compare programmer errors with business logic errors, technical problems, and fatal errors to choose an appropriate handling strategy. section 7.1 section 7.1.4
