Why the handler is written in halves
Read the input, then write the output. The split is where the error handling changes shape.
The testable form
A handler that takes a request and returns a response value. The server adapts it, and the test calls it directly.