mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number if applicable --> Error out on mismatched type for all component kinds. Same as #12305 but for all component kinds. #### Link to tracking issue Requires #12357 Fixes #12221
20 lines
609 B
Go
20 lines
609 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package internal // import "go.opentelemetry.io/collector/connector/internal"
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"go.opentelemetry.io/collector/component"
|
|
"go.opentelemetry.io/collector/pipeline"
|
|
)
|
|
|
|
func ErrDataTypes(id component.ID, from, to pipeline.Signal) error {
|
|
return fmt.Errorf("connector %q cannot connect from %s to %s: %w", id, from, to, pipeline.ErrSignalNotSupported)
|
|
}
|
|
|
|
func ErrIDMismatch(id component.ID, typ component.Type) error {
|
|
return fmt.Errorf("component type mismatch: component ID %q does not have type %q", id, typ)
|
|
}
|