Lesson 8.2

Central failure capture

Extend dispatch with normal and error modes, run four-parameter error middleware, and reject only when no error middleware responds or recovers.

38 minsrc/pipeline.js
  • Preserve Chapter 7's downstream tracking while routing failures forward through the remaining stack.
  • Select ordinary or error middleware from the function's declared parameter count.
  • Resolve dispatch after an error middleware responds or recovers, and reject when an error reaches the end unhandled.
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