Skip to content

Commit

Permalink
fix: a panic error occurs in the func WritePoint when dbserver has be…
Browse files Browse the repository at this point in the history
…en down (#81)

Signed-off-by: LENOVO\zhang <[email protected]>
Co-authored-by: ZhangJian He <[email protected]>
  • Loading branch information
njbestway and shoothzj authored Jun 28, 2024
1 parent a9068f3 commit f39ed79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion opengemini/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ func (c *client) WritePoint(ctx context.Context, database string, point *Point,

resp, err := c.innerWrite(database, &buffer)
if err != nil {
callback(errors.New("innerWrite request failed, error: " + err.Error()))
err := errors.New("innerWrite request failed, error: " + err.Error())
if callback != nil {
callback(err)
}
return nil
}

defer resp.Body.Close()
Expand Down

0 comments on commit f39ed79

Please sign in to comment.