Skip to content

Commit

Permalink
fix: retain full error information for blocking writes (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
pabigot committed Dec 22, 2021
1 parent 4218b50 commit 0c248b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/writeAPIBlocking.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package api

import (
"context"
"reflect"
"strings"

http2 "github.com/influxdata/influxdb-client-go/v2/api/http"
Expand Down Expand Up @@ -73,10 +74,10 @@ func NewWriteAPIBlocking(org string, bucket string, service http2.Service, write

func (w *writeAPIBlocking) write(ctx context.Context, line string) error {
err := w.service.WriteBatch(ctx, iwrite.NewBatch(line, w.writeOptions.RetryInterval(), w.writeOptions.MaxRetryTime()))
if err != nil {
return err.Unwrap()
if reflect.ValueOf(err).IsNil() {
return nil
}
return nil
return err
}

func (w *writeAPIBlocking) WriteRecord(ctx context.Context, line ...string) error {
Expand Down

0 comments on commit 0c248b5

Please sign in to comment.