Error handling: doing it right!
summary
Shows concrete fixes: create a shared application Error class with user-facing subclasses and status codes, log everything, and let most errors bubble to a single layer. Recommends async/await for meaningful V8 stack traces, use util.promisify instead of manual Promise constructors, retry outgoing requests (example: up to 10 tries for flaky Facebook API calls), and enable Node’s --unhandled-rejections / multiple resolve hooks to catch swallowed promise bugs.
AI-written summary · about
chapters (7)
- 0:00Start
- 13:17Unhandled rejections
- 18:17Error classes
- 19:04Error handler layers
- 25:07util.promisify
- 25:37unhandled-rejections
- 30:09Summary / Rules








