@@ -11,6 +11,7 @@ import (
1111 "github.com/ydb-platform/ydb-go-sdk/v3/internal/coordination"
1212 "github.com/ydb-platform/ydb-go-sdk/v3/internal/dial"
1313 "github.com/ydb-platform/ydb-go-sdk/v3/internal/discovery"
14+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/errors"
1415 "github.com/ydb-platform/ydb-go-sdk/v3/internal/logger"
1516 "github.com/ydb-platform/ydb-go-sdk/v3/internal/ratelimiter"
1617 "github.com/ydb-platform/ydb-go-sdk/v3/log"
@@ -93,19 +94,43 @@ func (db *db) Secure() bool {
9394 return db .config .Secure ()
9495}
9596
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 {
97104 return db .cluster .Invoke (ctx , method , args , reply , opts ... )
98105}
99106
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 ) {
101113 return db .cluster .NewStream (ctx , desc , method , opts ... )
102114}
103115
104116func (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
109134}
110135
111136func (db * db ) Table (opts ... Option ) table.Client {
0 commit comments