Skip to content

Commit

Permalink
fix: retain full error information for blocking writes (influxdata#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
pabigot committed Dec 22, 2021
1 parent 4218b50 commit 2de3554
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions api/writeAPIBlocking.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ 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()
}
return nil
return w.service.WriteBatch(ctx, iwrite.NewBatch(line, w.writeOptions.RetryInterval(), w.writeOptions.MaxRetryTime()))
}

func (w *writeAPIBlocking) WriteRecord(ctx context.Context, line ...string) error {
Expand Down
1 change: 1 addition & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func TestUserAgent(t *testing.T) {
assert.True(t, up)

err = c.WriteAPIBlocking("o", "b").WriteRecord(context.Background(), "a,a=a a=1i")
t.Logf("err %s", err)
assert.NoError(t, err)
}

Expand Down

0 comments on commit 2de3554

Please sign in to comment.