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.
What you will build
- 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.