File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,13 @@ impl LlmGenerationClient for Client {
101101 & retryable:: HEAVY_LOADED_OPTIONS ,
102102 )
103103 . await ?;
104+ if !resp. status ( ) . is_success ( ) {
105+ bail ! (
106+ "Anthropic API error: {:?}\n {}\n " ,
107+ resp. status( ) ,
108+ resp. text( ) . await ?
109+ ) ;
110+ }
104111 let mut resp_json: serde_json:: Value = resp. json ( ) . await . context ( "Invalid JSON" ) ?;
105112 if let Some ( error) = resp_json. get ( "error" ) {
106113 bail ! ( "Anthropic API error: {:?}" , error) ;
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ impl Default for RetryOptions {
9292
9393pub static HEAVY_LOADED_OPTIONS : RetryOptions = RetryOptions {
9494 max_retries : Some ( 10 ) ,
95- initial_backoff : Duration :: from_millis ( 1 ) ,
95+ initial_backoff : Duration :: from_secs ( 1 ) ,
9696 max_backoff : Duration :: from_secs ( 60 ) ,
9797} ;
9898
You can’t perform that action at this time.
0 commit comments