errors

package
v1.1.82 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 1 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInitServicesNotReady        = New(1001, "failed to initialize. Services are not ready")
	ErrStartingAgentStatusUpdate   = Newf(1004, "error starting %s update")
	ErrStartingVersionChecker      = Newf(1005, "%s. No version to compare for upgrade")
	ErrRegisterSubscriptionWebhook = New(1006, "unable to register subscription webhook")
	ErrGrpcConnection              = New(1007, "grpc client is not connected to central")
	ErrHarvesterConnection         = New(1008, "harvester client is not connected to central")
)

Generic Agent Errors

Functions

This section is empty.

Types

type AgentError

type AgentError struct {
	Code    int    `json:"code" structs:"code,omitempty"`
	Message string `json:"message" structs:"message,omitempty"`
	// contains filtered or unexported fields
}

AgentError - Agent Error

func New

func New(errCode int, errMessage string) *AgentError

New - Creates a new Agent Error

func Newf

func Newf(errCode int, errMessage string) *AgentError

Newf - Creates a new formatted Agent Error

func Wrap

func Wrap(agentError *AgentError, info string) *AgentError

Wrap -add additional data to a defined error

func (*AgentError) Error

func (e *AgentError) Error() string

Error - Returns the formatted error message

func (*AgentError) FormatError

func (e *AgentError) FormatError(args ...interface{}) error

FormatError - Creates a Error with applied formatting

func (*AgentError) GetErrorCode

func (e *AgentError) GetErrorCode() int

GetErrorCode - Returns the error code

Jump to

Keyboard shortcuts

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