@@ -291,13 +291,12 @@ func (a *anthropicClient) send(ctx context.Context, messages []message.Message,
292 // If there is an error we are going to see if we can retry the call
292 // If there is an error we are going to see if we can retry the call
293 if err != nil {
293 if err != nil {
294− slog.Error("Anthropic API error", "error", err.Error(), "attempt", attempts, "max_retries", maxRetries)
295 retry, after, retryErr := a.shouldRetry(attempts, err)
294 retry, after, retryErr := a.shouldRetry(attempts, err)
296 if retryErr != nil {
295 if retryErr != nil {
297 return nil, retryErr
296 return nil, retryErr
299 if retry {
298 if retry {
300− slog.Warn("Retrying due to rate limit", "attempt", attempts, "max_retries", maxRetries)
299+ slog.Warn("Retrying due to rate limit", "attempt", attempts, "max_retries", maxRetries, "error", err)
302 case <-ctx.Done():
301 case <-ctx.Done():
303 return nil, ctx.Err()
302 return nil, ctx.Err()
@@ -446,7 +445,7 @@ func (a *anthropicClient) stream(ctx context.Context, messages []message.Message
448 if retry {
447 if retry {
449− slog.Warn("Retrying due to rate limit", "attempt", attempts, "max_retries", maxRetries)
448+ slog.Warn("Retrying due to rate limit", "attempt", attempts, "max_retries", maxRetries, "error", err)
451 case <-ctx.Done():
450 case <-ctx.Done():
452 // context cancelled
451 // context cancelled