@@ -11,6 +11,7 @@ import (
11
11
"github.com/ydb-platform/ydb-go-sdk/v3/internal/coordination"
12
12
"github.com/ydb-platform/ydb-go-sdk/v3/internal/dial"
13
13
"github.com/ydb-platform/ydb-go-sdk/v3/internal/discovery"
14
+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/errors"
14
15
"github.com/ydb-platform/ydb-go-sdk/v3/internal/logger"
15
16
"github.com/ydb-platform/ydb-go-sdk/v3/internal/ratelimiter"
16
17
"github.com/ydb-platform/ydb-go-sdk/v3/log"
@@ -93,19 +94,43 @@ func (db *db) Secure() bool {
93
94
return db .config .Secure ()
94
95
}
95
96
96
- func (db * db ) Invoke (ctx context.Context , method string , args interface {}, reply interface {}, opts ... grpc.CallOption ) error {
97
+ func (db * db ) Invoke (
98
+ ctx context.Context ,
99
+ method string ,
100
+ args interface {},
101
+ reply interface {},
102
+ opts ... grpc.CallOption ,
103
+ ) error {
97
104
return db .cluster .Invoke (ctx , method , args , reply , opts ... )
98
105
}
99
106
100
- func (db * db ) NewStream (ctx context.Context , desc * grpc.StreamDesc , method string , opts ... grpc.CallOption ) (grpc.ClientStream , error ) {
107
+ func (db * db ) NewStream (
108
+ ctx context.Context ,
109
+ desc * grpc.StreamDesc ,
110
+ method string ,
111
+ opts ... grpc.CallOption ,
112
+ ) (grpc.ClientStream , error ) {
101
113
return db .cluster .NewStream (ctx , desc , method , opts ... )
102
114
}
103
115
104
116
func (db * db ) Close (ctx context.Context ) error {
105
- _ = db .Table ().Close (ctx )
106
- _ = db .Scheme ().Close (ctx )
107
- _ = db .Coordination ().Close (ctx )
108
- return db .cluster .Close (ctx )
117
+ issues := make ([]error , 0 , 4 )
118
+ if err := db .cluster .Close (ctx ); err != nil {
119
+ issues = append (issues , err )
120
+ }
121
+ if err := db .Table ().Close (ctx ); err != nil {
122
+ issues = append (issues , err )
123
+ }
124
+ if err := db .Scheme ().Close (ctx ); err != nil {
125
+ issues = append (issues , err )
126
+ }
127
+ if err := db .Coordination ().Close (ctx ); err != nil {
128
+ issues = append (issues , err )
129
+ }
130
+ if len (issues ) > 0 {
131
+ return errors .NewWithIssues ("close failed" , issues ... )
132
+ }
133
+ return nil
109
134
}
110
135
111
136
func (db * db ) Table (opts ... Option ) table.Client {
0 commit comments