Skip to content

Commit f5d54eb

Browse files
committed
[sidecar] better error handling for anthropic
we were eating some errors
1 parent 7e826a7 commit f5d54eb

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
@@ -470,6 +470,12 @@ impl AnthropicClient {
470470
return Err(LLMClientError::UnauthorizedAccess);
471471
}
472472

473+
if let Err(e) = response_stream.error_for_status_ref() {
474+
let body = response_stream.text().await?;
475+
println!("anthropic::err {body}");
476+
return Err(e.into());
477+
}
478+
473479
let mut event_source = response_stream.bytes_stream().eventsource();
474480

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

0 commit comments

Comments
 (0)