Skip to content

Commit 1767bbd

Browse files
committed
code health: unify error format in connection_pool
After the patch all errors in the connection_pool subpackage start with a lowercase letter [1]. 1. https://github.com/golang/go/wiki/CodeReviewComments#error-strings Part of #208
1 parent 22dfe17 commit 1767bbd

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

connection_pool/connection_pool.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ var (
2525
ErrWrongCheckTimeout = errors.New("wrong check timeout, must be greater than 0")
2626
ErrNoConnection = errors.New("no active connections")
2727
ErrTooManyArgs = errors.New("too many arguments")
28-
ErrIncorrectResponse = errors.New("Incorrect response format")
29-
ErrIncorrectStatus = errors.New("Incorrect instance status: status should be `running`")
30-
ErrNoRwInstance = errors.New("Can't find rw instance in pool")
31-
ErrNoRoInstance = errors.New("Can't find ro instance in pool")
32-
ErrNoHealthyInstance = errors.New("Can't find healthy instance in pool")
28+
ErrIncorrectResponse = errors.New("incorrect response format")
29+
ErrIncorrectStatus = errors.New("incorrect instance status: status should be `running`")
30+
ErrNoRwInstance = errors.New("can't find rw instance in pool")
31+
ErrNoRoInstance = errors.New("can't find ro instance in pool")
32+
ErrNoHealthyInstance = errors.New("can't find healthy instance in pool")
3333
)
3434

3535
/*

connection_pool/connection_pool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ func TestRoundRobinStrategy_NoReplica(t *testing.T) {
431431
// RO
432432
_, err = connPool.Eval("return box.cfg.listen", []interface{}{}, connection_pool.RO)
433433
require.NotNilf(t, err, "expected to fail after Eval, but error is nil")
434-
require.Equal(t, "Can't find ro instance in pool", err.Error())
434+
require.Equal(t, "can't find ro instance in pool", err.Error())
435435

436436
// ANY
437437
args := test_helpers.ListenOnInstanceArgs{
@@ -502,7 +502,7 @@ func TestRoundRobinStrategy_NoMaster(t *testing.T) {
502502
// RW
503503
_, err = connPool.Eval("return box.cfg.listen", []interface{}{}, connection_pool.RW)
504504
require.NotNilf(t, err, "expected to fail after Eval, but error is nil")
505-
require.Equal(t, "Can't find rw instance in pool", err.Error())
505+
require.Equal(t, "can't find rw instance in pool", err.Error())
506506

507507
// ANY
508508
args := test_helpers.ListenOnInstanceArgs{

connection_pool/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ func ExampleConnectionPool_SelectAsync_err() {
254254
fmt.Println("Future", 0, "Error", err)
255255

256256
// Output:
257-
// Future 0 Error Can't find rw instance in pool
257+
// Future 0 Error can't find rw instance in pool
258258
}
259259

260260
func ExampleConnectionPool_Ping() {

0 commit comments

Comments
 (0)