From 2d185f2d07e42b2202d646c80c47b59be4e59e76 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 24 Aug 2024 01:10:17 +0530 Subject: [PATCH] Use correct error variable for wrapped error --- exporter/clickhouselogsexporter/exporter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/clickhouselogsexporter/exporter.go b/exporter/clickhouselogsexporter/exporter.go index fcf18b91..0037a150 100644 --- a/exporter/clickhouselogsexporter/exporter.go +++ b/exporter/clickhouselogsexporter/exporter.go @@ -191,7 +191,7 @@ func (e *clickhouseLogsExporter) pushLogsData(ctx context.Context, ld plog.Logs) if err != nil { // StatementSend:code: 252, message: Too many partitions for single INSERT block // iterating twice since we want to try once after removing the old data - if i == 1 || !strings.Contains(err.Error(), "StatementSend:code: 252") { + if i == 1 || !strings.Contains(err.Error(), "code: 252") { // TODO(nitya): after returning it will be retried, ideally it should be pushed to DLQ return err } @@ -439,7 +439,7 @@ func (e *clickhouseLogsExporter) pushToClickhouse(ctx context.Context, ld plog.L // check the errors for i := 0; i < 3; i++ { if r := <-chErr; r != nil { - return fmt.Errorf("StatementSend:%w", err) + return fmt.Errorf("StatementSend:%w", r) } }