Skip to content

Commit

Permalink
Add the schema URLs to the returned error
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Feb 1, 2024
1 parent 47e7b94 commit 9f55256
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sdk/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package resource // import "go.opentelemetry.io/otel/sdk/resource"
import (
"context"
"errors"
"fmt"
"sync"

"go.opentelemetry.io/otel"
Expand Down Expand Up @@ -209,7 +210,12 @@ func Merge(a, b *Resource) (*Resource, error) {
}
// Return the merged resource with an appropriate error. It is up to
// the user to decide if the returned resource can be used or not.
return NewSchemaless(combine...), ErrSchemaURLConflict
return NewSchemaless(combine...), fmt.Errorf(
"%w: %s and %s",
ErrSchemaURLConflict,
a.schemaURL,
b.schemaURL,
)
}

// Empty returns an instance of Resource with no attributes. It is
Expand Down

0 comments on commit 9f55256

Please sign in to comment.