errors

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: Apache-2.0 Imports: 1 Imported by: 26

Documentation

Index

Constants

View Source
const (
	Emergency = iota // System unusable
	None             // None severity
	Alert            // Immediate action needed
	Critical         // Critical condition—default level
	Fatal            // Fatal condition

)

Variables

View Source
var (

	// GRPC server specific codes
	// Range 600-699
	ErrPanic        = "600"
	ErrGrpcListener = "601"
	ErrGrpcServer   = "602"

	// Config specific codes
	// Range 700-799
	ErrEmptyConfig = "700"
	ErrInMem       = "701"
	ErrViper       = "702"

	// Meshery adapter specific codes
	// Range 10100 to 10199
	ErrGetName        = "1000"
	ErrInstallMesh    = "1001"
	ErrMeshConfig     = "1002"
	ErrPortForward    = "1003"
	ErrClientConfig   = "1004"
	ErrClientSet      = "1005"
	ErrStreamEvent    = "1006"
	ErrOpInvalid      = "1007"
	ErrApplyOperation = "1008"
	ErrListOperations = "1009"

	// Meshkit specific codes
	// Range 10200 to 10299
	ErrSmiInit       = "kit_10200"
	ErrInstallSmi    = "kit_10201"
	ErrConnectSmi    = "kit_10202"
	ErrRunSmi        = "kit_10203"
	ErrDeleteSmi     = "kit_10204"
	ErrUnmarshal     = "kit_10205"
	ErrMarshal       = "kit_10205"
	ErrGetBool       = "kit_10205"
	ErrApplyManifest = "kit_10206"
)
View Source
var (
	NoneString = []string{"None"}
)

Functions

func GetCause added in v0.1.18

func GetCause(err error) string

func GetCode

func GetCode(err error) string

func GetRemedy

func GetRemedy(err error) string

func GetSDescription added in v0.1.18

func GetSDescription(err error) string

Types

type Error

type Error struct {
	Code                 string
	Severity             Severity
	ShortDescription     []string
	LongDescription      []string
	ProbableCause        []string
	SuggestedRemediation []string
}

func Is

func Is(err error) (*Error, bool)

func New

func New(code string, severity Severity, sdescription []string, ldescription []string, probablecause []string, remedy []string) *Error

func NewDefault

func NewDefault(code string, sdescription ...string) *Error

func (*Error) Error

func (e *Error) Error() string

type Severity

type Severity int

func GetSeverity

func GetSeverity(err error) Severity

Jump to

Keyboard shortcuts

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