consumererror

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 120

Documentation

Overview

Package consumererror provides wrappers to easily classify errors. This allows appropriate action by error handlers without the need to know each individual error type/instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsLogs added in v0.24.0

func AsLogs(err error, target *Logs) bool

AsLogs finds the first error in err's chain that can be assigned to target. If such an error is found, it is assigned to target and true is returned, otherwise false is returned.

func AsMetrics added in v0.24.0

func AsMetrics(err error, target *Metrics) bool

AsMetrics finds the first error in err's chain that can be assigned to target. If such an error is found, it is assigned to target and true is returned, otherwise false is returned.

func AsTraces added in v0.24.0

func AsTraces(err error, target *Traces) bool

AsTraces finds the first error in err's chain that can be assigned to target. If such an error is found, it is assigned to target and true is returned, otherwise false is returned.

func Combine added in v0.24.0

func Combine(errs []error) error

Combine converts a list of errors into one error.

If any of the errors in errs are Permanent then the returned error will also be Permanent.

Any signal data associated with an error from this package will be discarded.

func IsPermanent

func IsPermanent(err error) bool

IsPermanent checks if an error was wrapped with the Permanent function, which is used to indicate that a given error will always be returned in the case that its sources receives the same input.

func NewLogs added in v0.24.0

func NewLogs(err error, failed pdata.Logs) error

NewLogs creates a Logs that can encapsulate received data that failed to be processed or sent.

func NewMetrics added in v0.24.0

func NewMetrics(err error, failed pdata.Metrics) error

NewMetrics creates a Metrics that can encapsulate received data that failed to be processed or sent.

func NewTraces added in v0.24.0

func NewTraces(err error, failed pdata.Traces) error

NewTraces creates a Traces that can encapsulate received data that failed to be processed or sent.

func Permanent

func Permanent(err error) error

Permanent wraps an error to indicate that it is a permanent error, i.e. an error that will be always returned if its source receives the same inputs.

Types

type Logs added in v0.24.0

type Logs struct {
	// contains filtered or unexported fields
}

Logs is an error that may carry associated Log data for a subset of received data that failed to be processed or sent.

func (Logs) GetLogs added in v0.24.0

func (err Logs) GetLogs() pdata.Logs

GetLogs returns failed logs from the associated error.

func (Logs) Unwrap added in v0.26.0

func (err Logs) Unwrap() error

Unwrap returns the wrapped error for functions Is and As in standard package errors.

type Metrics added in v0.24.0

type Metrics struct {
	// contains filtered or unexported fields
}

Metrics is an error that may carry associated Metrics data for a subset of received data that failed to be processed or sent.

func (Metrics) GetMetrics added in v0.24.0

func (err Metrics) GetMetrics() pdata.Metrics

GetMetrics returns failed metrics from the associated error.

func (Metrics) Unwrap added in v0.26.0

func (err Metrics) Unwrap() error

Unwrap returns the wrapped error for functions Is and As in standard package errors.

type Traces added in v0.24.0

type Traces struct {
	// contains filtered or unexported fields
}

Traces is an error that may carry associated Trace data for a subset of received data that failed to be processed or sent.

func (Traces) GetTraces added in v0.24.0

func (err Traces) GetTraces() pdata.Traces

GetTraces returns failed traces from the associated error.

func (Traces) Unwrap added in v0.26.0

func (err Traces) Unwrap() error

Unwrap returns the wrapped error for functions Is and As in standard package errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL