fix: return error on non-2xx response in stream_generate_content (#3) #4
Reference in New Issue
Block a user
Delete Branch "fix/stream-non-2xx-handling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #3
Before building the event stream in GeminiClient::stream_generate_content, check response.status(). On a non-success status, parse the body as GenerateContentResponseError when possible (returning Error::VertexError) and fall back to Error::HttpStatus with the HTTP status and raw text.
Includes unit tests covering: