Start here. This is the direct spoken answer to practice first.
Why this question matters
Central exception handling works cleanly only while the server still owns an uncommitted response. Streaming and early writes change what recovery is possible on the same HTTP exchange.
ASP.NET Core does not buffer every response body by default. Once the response starts, its status code and headers have been sent and cannot be replaced with a different 500 response or Problem Details document. The response can start when code writes or flushes the body, starts it explicitly, or a formatter begins producing output. HttpResponse.HasStarted tells middleware whether that boundary has been crossed. Exception-handling middleware placed early can catch downstream exceptions, log them, and create a clean error response only when the original response has not started. If bytes are already committed, the server usually has to stop further output and terminate or reset the response, so the client may receive a partial payload rather than a second valid response document.