// Code generated by gotmpl. DO NOT MODIFY.
// source: internal/shared/otlp/partialsuccess.go

// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal"

import 

// PartialSuccess represents the underlying error for all handling
// OTLP partial success messages.  Use `errors.Is(err,
// PartialSuccess{})` to test whether an error passed to the OTel
// error handler belongs to this category.
type PartialSuccess struct {
	ErrorMessage  string
	RejectedItems int64
	RejectedKind  string
}

var _ error = PartialSuccess{}

// Error implements the error interface.
func ( PartialSuccess) () string {
	 := .ErrorMessage
	if  == "" {
		 = "empty message"
	}
	return fmt.Sprintf("OTLP partial success: %s (%d %s rejected)", , .RejectedItems, .RejectedKind)
}

// Is supports the errors.Is() interface.
func ( PartialSuccess) ( error) bool {
	,  := .(PartialSuccess)
	return 
}

// TracePartialSuccessError returns an error describing a partial success
// response for the trace signal.
func ( int64,  string) error {
	return PartialSuccess{
		ErrorMessage:  ,
		RejectedItems: ,
		RejectedKind:  "spans",
	}
}

// MetricPartialSuccessError returns an error describing a partial success
// response for the metric signal.
func ( int64,  string) error {
	return PartialSuccess{
		ErrorMessage:  ,
		RejectedItems: ,
		RejectedKind:  "metric data points",
	}
}