errors

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 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    = "10200"
	ErrInstallSmi = "10201"
	ErrConnectSmi = "10202"
	ErrRunSmi     = "10203"
	ErrDeleteSmi  = "10204"
	ErrUnmarshal  = "10205"
	ErrMarshal    = "10205"
	ErrGetBool    = "10205"
)

Functions

func GetCode

func GetCode(err error) string

func GetRemedy

func GetRemedy(err error) []string

Types

type Error

type Error struct {
	Code        string
	Severity    Severity
	Description []string
	Remedy      []string
}

func Is

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

func New

func New(code string, severity Severity, description []string, remedy []string) *Error

func NewDefault

func NewDefault(code string, description ...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