Skip to content

Commit ca5f6f7

Browse files
committed
[sidecar] better error handling for anthropic
we were eating some errors
1 parent 33933a2 commit ca5f6f7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llm_client/src/clients/anthropic.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,12 @@ impl AnthropicClient {
482482
return Err(LLMClientError::UnauthorizedAccess);
483483
}
484484

485+
if let Err(e) = response_stream.error_for_status_ref() {
486+
let body = response_stream.text().await?;
487+
println!("anthropic::err {body}");
488+
return Err(e.into());
489+
}
490+
485491
let mut event_source = response_stream.bytes_stream().eventsource();
486492

487493
// let event_next = event_source.next().await;

0 commit comments

Comments
 (0)