Lesson 8.3

headersSent decides the error action

Catch an unhandled dispatch failure in App.handle, write a generic response before emission, and destroy the affected socket after emission.

32 minsrc/app.js
  • Explain what res.headersSent proves and why a second response is invalid.
  • Make App.handle resolve after every application-level handler failure.
  • Map an exposed HttpError to a generic status phrase without leaking its message or stack.
Locked

This chapter is part of the framework capstone. Chapters 1 and 2 are free to build - unlock the rest to keep going.

Unlock the depth