Quiz 3 Question 20 of 20

A customer support platform streams Claude responses to end users via SSE (Server-Sent Events). The platform proxies Claude's streaming API through its own backend. Engineers report that when Claude's API returns a 500 error mid-stream — after tokens have already been sent to the customer — the platform's error handling code attempts to send an HTTP 500 status, which fails because the HTTP response was already committed with a 200 header. What is the correct architectural pattern for handling mid-stream errors?

Select an answer to reveal the explanation.

Motivation