Error handling#
Choose the outcome that matches the situation: Result for an expected failure with an explanation, Optional for a missing value, and a fault for a broken programming assumption. These pages show how callers respond to each one.
| Concept | What you will learn |
|---|---|
| Expected failures with Result | Return success or domain errors as ordinary values. |
| Error propagation with try | Forward compatible errors without hiding faults or cancellation. |
| Programming faults | Check invariants and understand task failure after cleanup. |