@@ -81,19 +81,7 @@ func createSession(
8181
8282 response , err := client .CreateSession (ctx , & Ydb_Query.CreateSessionRequest {})
8383 if err != nil {
84- if xerrors .IsContextError (err ) {
85- return nil , xerrors .WithStackTrace (err )
86- }
87-
88- return nil , xerrors .WithStackTrace (
89- xerrors .Transport (err ),
90- )
91- }
92-
93- if response .GetStatus () != Ydb .StatusIds_SUCCESS {
94- return nil , xerrors .WithStackTrace (
95- xerrors .FromOperation (response ),
96- )
84+ return nil , xerrors .WithStackTrace (err )
9785 }
9886
9987 defer func () {
@@ -107,9 +95,7 @@ func createSession(
10795
10896 err = s .attach (ctx )
10997 if err != nil {
110- return nil , xerrors .WithStackTrace (
111- xerrors .Transport (err ),
112- )
98+ return nil , xerrors .WithStackTrace (err )
11399 }
114100
115101 s .setStatus (statusIdle )
@@ -129,20 +115,14 @@ func (s *Session) attach(ctx context.Context) (finalErr error) {
129115 SessionId : s .id ,
130116 })
131117 if err != nil {
132- if xerrors .IsContextError (err ) {
133- return xerrors .WithStackTrace (err )
134- }
135-
136- return xerrors .WithStackTrace (
137- xerrors .Transport (err ),
138- )
118+ return xerrors .WithStackTrace (err )
139119 }
140120
141121 state , err := attach .Recv ()
142122 if err != nil {
143123 cancelAttach ()
144124
145- return xerrors .WithStackTrace (xerrors . Transport ( err ) )
125+ return xerrors .WithStackTrace (err )
146126 }
147127
148128 if state .GetStatus () != Ydb .StatusIds_SUCCESS {
@@ -173,19 +153,14 @@ func (s *Session) attach(ctx context.Context) (finalErr error) {
173153 if ! s .IsAlive () {
174154 return
175155 }
176- recv , recvErr := attach .Recv ()
156+ _ , recvErr := attach .Recv ()
177157 if recvErr != nil {
178158 if xerrors .Is (recvErr , io .EOF ) {
179159 s .setStatus (statusClosed )
180160 } else {
181161 s .setStatus (statusError )
182162 }
183163
184- return
185- }
186- if recv .GetStatus () != Ydb .StatusIds_SUCCESS {
187- s .setStatus (statusError )
188-
189164 return
190165 }
191166 }
@@ -201,11 +176,7 @@ func deleteSession(ctx context.Context, client Ydb_Query_V1.QueryServiceClient,
201176 },
202177 )
203178 if err != nil {
204- if xerrors .IsContextError (err ) {
205- return xerrors .WithStackTrace (err )
206- }
207-
208- return xerrors .WithStackTrace (xerrors .Transport (err ))
179+ return xerrors .WithStackTrace (err )
209180 }
210181 if response .GetStatus () != Ydb .StatusIds_SUCCESS {
211182 return xerrors .WithStackTrace (xerrors .FromOperation (response ))
@@ -252,16 +223,7 @@ func begin(
252223 },
253224 )
254225 if err != nil {
255- if xerrors .IsContextError (err ) {
256- return nil , xerrors .WithStackTrace (err )
257- }
258-
259- return nil , xerrors .WithStackTrace (
260- xerrors .Transport (err ),
261- )
262- }
263- if response .GetStatus () != Ydb .StatusIds_SUCCESS {
264- return nil , xerrors .WithStackTrace (xerrors .FromOperation (response ))
226+ return nil , xerrors .WithStackTrace (err )
265227 }
266228
267229 return newTransaction (response .GetTxMeta ().GetId (), s , s .trace ), nil
0 commit comments