Skip to content

Commit

Permalink
refactor: extract ErrNoAddress (#214)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhangjian He <hezhangjian97@gmail.com>
  • Loading branch information
hezhangjian authored Jan 13, 2025
1 parent fc73b67 commit f4c4f1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion opengemini/client_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type client struct {

func newClient(c *Config) (Client, error) {
if len(c.Addresses) == 0 {
return nil, errors.New("must have at least one address")
return nil, ErrNoAddress
}
if c.AuthConfig != nil {
if c.AuthConfig.AuthType == AuthTypeToken && len(c.AuthConfig.Token) == 0 {
Expand Down
1 change: 1 addition & 0 deletions opengemini/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var (
ErrEmptyCommand = errors.New("empty command")
ErrEmptyTagOrField = errors.New("empty tag or field")
ErrEmptyTagKey = errors.New("empty tag key")
ErrNoAddress = errors.New("must have at least one address")
ErrRetentionPolicy = errors.New("empty retention policy")
)

Expand Down

0 comments on commit f4c4f1d

Please sign in to comment.