Skip to content

Commit

Permalink
added handle error places
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby committed Jan 15, 2025
1 parent c0e1abe commit c978f54
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/query/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ func (tx *Transaction) QueryResultSet(
}
r, err := execute(ctx, tx.s.ID(), tx.s.client, q, settings, resultOpts...)
if err != nil {
tx.s.setStatusFromError(err)

return nil, xerrors.WithStackTrace(err)
}

Expand Down Expand Up @@ -163,6 +165,8 @@ func (tx *Transaction) QueryRow(
}
r, err := execute(ctx, tx.s.ID(), tx.s.client, q, settings, resultOpts...)
if err != nil {
tx.s.setStatusFromError(err)

return nil, xerrors.WithStackTrace(err)
}

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

r, err := execute(ctx, tx.s.ID(), tx.s.client, q, settings, resultOpts...)
if err != nil {
tx.s.setStatusFromError(err)
return xerrors.WithStackTrace(err)
}

Expand Down Expand Up @@ -297,6 +302,8 @@ func (tx *Transaction) Query(ctx context.Context, q string, opts ...options.Exec
}
r, err := execute(ctx, tx.s.ID(), tx.s.client, q, settings, resultOpts...)
if err != nil {
tx.s.setStatusFromError(err)

return nil, xerrors.WithStackTrace(err)
}

Expand Down

0 comments on commit c978f54

Please sign in to comment.