Skip to content

Commit c768538

Browse files
Do not log nil error in bulk indexer (#574) (#579)
Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.de>
1 parent 0ec9c4f commit c768538

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

esutil/bulk_indexer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ func (w *worker) flush(ctx context.Context) error {
592592
atomic.AddUint64(&w.bi.stats.numFailed, uint64(len(w.items)))
593593
// TODO(karmi): Wrap error (include response struct)
594594
if w.bi.config.OnError != nil {
595-
w.bi.config.OnError(ctx, fmt.Errorf("flush: %s", err))
595+
w.bi.config.OnError(ctx, fmt.Errorf("flush: %s", res.String()))
596596
}
597597
return fmt.Errorf("flush: %s", res.String())
598598
}

0 commit comments

Comments
 (0)