# Shared Error-Handling Patterns

- Subclass `Error` with typed messages
- Never swallow errors silently
- Prefer `Result<T, E>` return types in business logic
- Log only at boundaries, never inside pure functions
- Validate inputs only at the system edge
- Treat all third-party API responses as untrusted input
- Bail early on contract violations rather than degrading silently
