mirror of https://github.com/go-redis/redis.git
Don't record proto.Nil
This commit is contained in:
parent
1831363467
commit
8f29d08432
|
@ -7,6 +7,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"github.com/go-redis/redis/v8/internal/proto"
|
||||||
"github.com/go-redis/redis/v8/internal/util"
|
"github.com/go-redis/redis/v8/internal/util"
|
||||||
"go.opentelemetry.io/otel/api/global"
|
"go.opentelemetry.io/otel/api/global"
|
||||||
"go.opentelemetry.io/otel/api/trace"
|
"go.opentelemetry.io/otel/api/trace"
|
||||||
|
@ -147,6 +148,8 @@ func WithSpan(ctx context.Context, name string, fn func(context.Context) error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RecordError(ctx context.Context, err error) error {
|
func RecordError(ctx context.Context, err error) error {
|
||||||
|
if err != proto.Nil {
|
||||||
trace.SpanFromContext(ctx).RecordError(ctx, err)
|
trace.SpanFromContext(ctx).RecordError(ctx, err)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue