error
Handle errors gracefully.
Patterns
- Fail fast: detect early
- Return vs throw: expected vs unexpected
- Custom error classes with codes
- Graceful degradation
- Retry with backoff
- Circuit breaker
HTTP errors
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 500 Internal Server Error