diff --git a/update.go b/update.go index b6e6f9a..b8e2f72 100644 --- a/update.go +++ b/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 }