fix: return error on non-2xx response in stream_generate_content (#3) #4

Merged
andreban merged 2 commits from fix/stream-non-2xx-handling into main 2026-10-18 22:54:24 +01:00

2 Commits

Author SHA1 Message Date
9bade7a1e6 test: move client unit tests to sibling client_tests.rs per rust-testing conventions
Some checks failed
Rust / build (pull_request) Has been cancelled
2026-10-18 22:52:40 +01:00
ba9870277c fix: return error on non-2xx response in stream_generate_content (#3)
Some checks failed
Rust / build (pull_request) Has been cancelled
Check response.status() before building the SSE event stream. On non-success
status, parse the response body as GenerateContentResponseError when
possible (returning Error::VertexError), and fall back to Error::HttpStatus
with the status code and raw text. Adds tests for HTTP 400 Vertex error,
non-JSON HTTP 500 error, and successful 200 SSE streaming.
2026-10-18 22:47:23 +01:00