anthropic.internal._sse_failure

(internal) `fetch_sse` fails a non-2xx status itself, throwing baml.errors.Io with the status and body in its message ("SSE request failed with status 401: …"). Recover the status and route it through the SAME classifier the non-streaming path uses: a 400 or 401 must never come back as a retry-safe NetworkFailure, or ai.clients.Retry cheerfully replays a request that can never succeed.

Reference version

Signature

function anthropic.internal._sse_failure(message: string) -> ai.errors.Failure

(internal) fetch_sse fails a non-2xx status itself, throwing baml.errors.Io with the status and body in its message ("SSE request failed with status 401: …"). Recover the status and route it through the SAME classifier the non-streaming path uses: a 400 or 401 must never come back as a retry-safe NetworkFailure, or ai.clients.Retry cheerfully replays a request that can never succeed.

Source:<builtin>/anthropic/ns_internal/messages.bamlbytes 4866749514