Skip to content

Commit

Permalink
chore: error uses the common naming format (#108)
Browse files Browse the repository at this point in the history
Signed-off-by: lookupman <[email protected]>
  • Loading branch information
dream-kzx authored Jul 14, 2024
1 parent 8c6c219 commit 0953ba0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions opengemini/servers_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"
)

var allServersDown = errors.New("all servers down")
var ErrAllServersDown = errors.New("all servers down")

const (
healthCheckPeriod = time.Second * 10
Expand Down Expand Up @@ -55,5 +55,5 @@ func (c *client) getServerUrl() (string, error) {
}
return c.endpoints[idx].url, nil
}
return "", allServersDown
return "", ErrAllServersDown
}
2 changes: 1 addition & 1 deletion opengemini/servers_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestServerCheck(t *testing.T) {

time.Sleep(time.Second * 15)
_, err = cli.getServerUrl()
assert.Equal(t, allServersDown, err)
assert.Equal(t, ErrAllServersDown, err)

err = cli.Close()
assert.NoError(t, err)
Expand Down

0 comments on commit 0953ba0

Please sign in to comment.