domains / families / software-engineering / m06-error-handling
m06-error-handling
separate
CRITICAL: Use for error handling. Triggers: Result, Option, Error, ?, unwrap, expect, panic, anyhow, thiserror, when to panic vs return Result, custom error, error propagation, 错误处理, Result 用法, 什么时候用 panic
When to use
- Choosing between Result and Option
- Deciding when to panic vs return Result
- Selecting thiserror for library code
- Selecting anyhow for application code
- Propagating errors with context
- Handling custom error types
- Resolving unwrap panics
- Designing error granularity
When not to use
- Domain error strategy details
- Crate boundary management
- Type-safe error implementation details
- Mental model construction
Skill page
Source