Skip to content

Commit 22ba8da

Browse files
committed
wrapped_session: fix method names
For wrapped_session.go: s/Client/Session/g
1 parent 7bcdd17 commit 22ba8da

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

wrapped_session.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type wrappedSession struct {
2727
}
2828

2929
func (ws *wrappedSession) EndSession(ctx context.Context) {
30-
ctx, span := roundtripTrackingSpan(ctx, "github.com/mongodb/mongo-go-driver.Client.EndSession")
30+
ctx, span := roundtripTrackingSpan(ctx, "github.com/mongodb/mongo-go-driver.Session.EndSession")
3131
defer span.end(ctx)
3232

3333
ws.ss.EndSession(ctx)
@@ -38,11 +38,18 @@ func (ws *wrappedSession) StartTransaction(topts ...transactionopt.Transaction)
3838
}
3939

4040
func (ws *wrappedSession) AbortTransaction(ctx context.Context) error {
41-
return ws.ss.AbortTransaction(ctx)
41+
ctx, span := roundtripTrackingSpan(ctx, "github.com/mongodb/mongo-go-driver.Session.AbortTransaction")
42+
defer span.end(ctx)
43+
44+
err := ws.ss.AbortTransaction(ctx)
45+
if err != nil {
46+
span.setError(err)
47+
}
48+
return err
4249
}
4350

4451
func (ws *wrappedSession) CommitTransaction(ctx context.Context) error {
45-
ctx, span := roundtripTrackingSpan(ctx, "github.com/mongodb/mongo-go-driver.Client.EndSession")
52+
ctx, span := roundtripTrackingSpan(ctx, "github.com/mongodb/mongo-go-driver.Session.CommitTransaction")
4653
defer span.end(ctx)
4754

4855
err := ws.ss.CommitTransaction(ctx)

0 commit comments

Comments
 (0)