Make code observable and resilient without over-doing it.
Coding💾 0 savesby PromptChief Team
Help me add proper logging and error handling to this code.
CODE:
```
[[CODE]]
```
LANGUAGE/STACK: [[STACK]]
WHERE IT RUNS: [[ENVIRONMENT]]
Deliver:
1. Where to add error handling (and what to catch vs let bubble up)
2. What to log, at what level (debug/info/warn/error) — and what NOT to log (secrets/PII)
3. User-facing vs internal error messages
4. Retry/fallback where it makes sense
5. The refactored code
Avoid noisy logs and swallowing errors silently.