Add logs for method UpdateBuilder.ExecContext.
This commit is contained in:
parent
3db7e50f1a
commit
f1ec6d0fc6
10
update.go
10
update.go
|
@ -8,6 +8,7 @@ import (
|
|||
"time"
|
||||
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
)
|
||||
|
||||
const tracerName = "git.bit5.ru/backend/dbr"
|
||||
|
@ -218,5 +219,12 @@ func (b *UpdateBuilder) ExecContext(ctx context.Context) (sql.Result, error) {
|
|||
_, span := tracer.Start(ctx, "UpdateBuilder.ExecContext")
|
||||
defer span.End()
|
||||
|
||||
return b.Exec()
|
||||
res, err := b.Exec()
|
||||
if err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return res, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue