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

    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

      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

        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

          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, that is used to indicate that a given error will always be returned in the case that its sources receives the same input.

              func NewLogs

              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

                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

                  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

                      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 faiiled to be processed or sent.

                        func (Logs) GetLogs

                        func (err Logs) GetLogs() pdata.Logs

                          GetLogs returns failed logs from the associated error.

                          type Metrics

                          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 faiiled to be processed or sent.

                            func (Metrics) GetMetrics

                            func (err Metrics) GetMetrics() pdata.Metrics

                              GetMetrics returns failed metrics from the associated error.

                              type Traces

                              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 faiiled to be processed or sent.

                                func (Traces) GetTraces

                                func (err Traces) GetTraces() pdata.Traces

                                  GetTraces returns failed traces from the associated error.