errors

package
v0.0.0-...-5e778ce Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoscalerError

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

AutoscalerError contains information about Autoscaler errors

func NewAutoscalerError

func NewAutoscalerError(errorType AutoscalerErrorType, msg string, args ...interface{}) *AutoscalerError

NewAutoscalerError returns new autoscaler error with a message constructed from format string

func ToAutoscalerError

func ToAutoscalerError(defaultType AutoscalerErrorType, err error) *AutoscalerError

ToAutoscalerError converts an error to AutoscalerError with given type, unless it already is an AutoscalerError (in which case it's not modified).

func (*AutoscalerError) AddPrefix

func (e *AutoscalerError) AddPrefix(msg string, args ...interface{}) *AutoscalerError

AddPrefix adds a prefix to error message. Returns the error it's called for convienient inline use. Example:

if err := DoSomething(myObject); err != nil {
	return err.AddPrefix("can't do something with %v: ", myObject)
}

func (*AutoscalerError) Error

func (e *AutoscalerError) Error() string

Error implements golang error interface

func (*AutoscalerError) Type

Type returns the typ of AutoscalerError

type AutoscalerErrorType

type AutoscalerErrorType string

AutoscalerErrorType describes a high-level category of a given error

const (
	// CloudProviderError is an error related to underlying infrastructure
	CloudProviderError AutoscalerErrorType = "cloudProviderError"
	// ApiCallError is an error related to communication with k8s API server
	ApiCallError AutoscalerErrorType = "apiCallError"
	// InternalError is an error inside Cluster Autoscaler
	InternalError AutoscalerErrorType = "internalError"
	// TransientError is an error that causes us to skip a single loop, but
	// does not require any additional action.
	TransientError AutoscalerErrorType = "transientError"
)

Jump to

Keyboard shortcuts

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