errors

package
v0.0.0-...-73e42e7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutorepairError

type AutorepairError interface {
	// Error implements golang error interface
	Error() string

	// Type returns the typ of AutorepairError
	Type() AutorepairErrorType

	// 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)
	// }
	AddPrefix(msg string, args ...interface{}) AutorepairError
}

AutorepairrError contains information about Autorepair errors

func NewAutorepairError

func NewAutorepairError(errorType AutorepairErrorType, msg string, args ...interface{}) AutorepairError

NewAutorepairError returns new autorepair error with a message constructed from format string

func ToAutorepairError

func ToAutorepairError(defaultType AutorepairErrorType, err error) AutorepairError

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

type AutorepairErrorType

type AutorepairErrorType string

AutorepairErrorType describes a high-level category of a given error

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

Jump to

Keyboard shortcuts

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