diff --git a/CHANGELOG.md b/CHANGELOG.md index 39078e56970..f074549afb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Remove use of deprecated `"math/rand".Seed` in `go.opentelemetry.io/otel/example/prometheus`. (#3733) - Do not silently drop unknown schema data with `Parse` in `go.opentelemetry.io/otel/schema/v1.1`. (#3743) - Data race issue in OTLP exporter retry mechanism. (#3756) +- Fixes wrapping a nil error in some cases (#????) ## [1.13.0/0.36.0] 2023-02-07 diff --git a/sdk/metric/pipeline.go b/sdk/metric/pipeline.go index c58c113e2b3..91e29aa2f9a 100644 --- a/sdk/metric/pipeline.go +++ b/sdk/metric/pipeline.go @@ -551,6 +551,9 @@ func (m *multierror) errorOrNil() error { if len(m.errors) == 0 { return nil } + if m.wrapped == nil { + return errors.New(strings.Join(m.errors, "; ")) + } return fmt.Errorf("%w: %s", m.wrapped, strings.Join(m.errors, "; ")) }