On this page
  1. Error-Handling Philosophies
  2. Contents
  3. Three Primary Error Models
  4. Bugs vs. Expected Failures

Error-Handling Philosophies

Prev: Modularity, Cohesion & Coupling | Up: software_design | Next: Testing & Maintainability
Rel: Type Systems, Python Error Handling, JS Error Handling
Ref: Wikipedia — Exception Handling
Tags: #public #prog #programming #design #errors


Contents


Three Primary Error Models

Model Examples Mechanism Trade-off
Return / Error Codes C (errno), Go (val, err) Explicit return value checked by caller Visible control flow; verbose if ignored
Algebraic Result / Option Rust, Haskell, Swift Compiler-enforced sum types (Ok/Err, Some/None) Eliminates null crashes & unhandled errors
Exceptions Python, Java, JavaScript Unwinds call stack to nearest catch/except Clean happy path; hidden exit paths

Bugs vs. Expected Failures

Linked from

Related notes