Skip to content

Commit b1771ba

Browse files
committed
fix(graphrag): add error context to batch retry logs
1 parent 5739cb1 commit b1771ba

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • src/indexer/graphrag

‎src/indexer/graphrag/ai.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,16 @@ impl AIEnhancements {
374374
for attempt in 0..=Self::MAX_BATCH_RETRIES {
375375
if attempt > 0 {
376376
let delay = Duration::from_secs(5 * (1 << (attempt - 1))); // 5s, 10s, 20s
377+
let err_msg = last_error
378+
.as_ref()
379+
.map(|e: &anyhow::Error| e.to_string())
380+
.unwrap_or_default();
377381
if !self.quiet {
378382
eprintln!(
379-
"⚠️ AI batch attempt {}/{} failed, retrying in {:?}...",
383+
"⚠️ AI batch attempt {}/{} failed ({}), retrying in {:?}...",
380384
attempt,
381385
Self::MAX_BATCH_RETRIES + 1,
386+
err_msg,
382387
delay
383388
);
384389
}

0 commit comments

Comments
 (0)