Skip to content

Commit 0292c61

Browse files
committed
fix: proper return value of blocking-write-api
Pull Request #350 (commit a9c1e37) introduced `Flush()` and `Write()` functions blindly returning the result of a `func (Service) WriteBatch(...) *http2.Error`. This causes the returned error to always evaluate as `non-nil`. Fixes #360
1 parent 6bd9713 commit 0292c61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/writeAPIBlocking.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ func (w *writeAPIBlocking) flush(ctx context.Context) error {
119119
body := strings.Join(w.batch, "\n")
120120
w.batch = w.batch[:0]
121121
b := iwrite.NewBatch(body, w.writeOptions.MaxRetryTime())
122-
return w.service.WriteBatch(ctx, b)
122+
if err:= w.service.WriteBatch(ctx, b); err != nil {
123+
return err
124+
}
123125
}
124126
return nil
125127
}

0 commit comments

Comments
 (0)