Skip to content

Commit c978f54

Browse files
committed
added handle error places
1 parent c0e1abe commit c978f54

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/query/transaction.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ func (tx *Transaction) QueryResultSet(
114114
}
115115
r, err := execute(ctx, tx.s.ID(), tx.s.client, q, settings, resultOpts...)
116116
if err != nil {
117+
tx.s.setStatusFromError(err)
118+
117119
return nil, xerrors.WithStackTrace(err)
118120
}
119121

@@ -163,6 +165,8 @@ func (tx *Transaction) QueryRow(
163165
}
164166
r, err := execute(ctx, tx.s.ID(), tx.s.client, q, settings, resultOpts...)
165167
if err != nil {
168+
tx.s.setStatusFromError(err)
169+
166170
return nil, xerrors.WithStackTrace(err)
167171
}
168172

@@ -229,6 +233,7 @@ func (tx *Transaction) Exec(ctx context.Context, q string, opts ...options.Execu
229233

230234
r, err := execute(ctx, tx.s.ID(), tx.s.client, q, settings, resultOpts...)
231235
if err != nil {
236+
tx.s.setStatusFromError(err)
232237
return xerrors.WithStackTrace(err)
233238
}
234239

@@ -297,6 +302,8 @@ func (tx *Transaction) Query(ctx context.Context, q string, opts ...options.Exec
297302
}
298303
r, err := execute(ctx, tx.s.ID(), tx.s.client, q, settings, resultOpts...)
299304
if err != nil {
305+
tx.s.setStatusFromError(err)
306+
300307
return nil, xerrors.WithStackTrace(err)
301308
}
302309

0 commit comments

Comments
 (0)