errors

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Error codes
	// Returned for unknown request type
	BAD_REQUEST = 101
	// General-purpose errors
	NOT_FOUND      = 201
	ALREADY_EXISTS = 202
	WRONG_TYPE     = 203
	BAD_IPVER      = 204
	NO_VM          = 205
	NO_VNI         = 206
	ITERATOR       = 207
	OUT_OF_MEMORY  = 208
	LIMIT_REACHED  = 209
	ALREADY_ACTIVE = 210
	NOT_ACTIVE     = 211
	ROLLBACK       = 212
	RTE_RULE_ADD   = 213
	RTE_RULE_DEL   = 214
	// Specific errors
	ROUTE_EXISTS    = 301
	ROUTE_NOT_FOUND = 302
	ROUTE_INSERT    = 303
	ROUTE_BAD_PORT  = 304
	ROUTE_RESET     = 305
	DNAT_NO_DATA    = 321
	DNAT_CREATE     = 322
	DNAT_EXISTS     = 323
	SNAT_NO_DATA    = 341
	SNAT_CREATE     = 342
	SNAT_EXISTS     = 343
	VNI_INIT4       = 361
	VNI_INIT6       = 362
	VNI_FREE4       = 363
	VNI_FREE6       = 364
	PORT_START      = 381
	PORT_STOP       = 382
	VNF_INSERT      = 401
	VM_HANDLE       = 402
	NO_BACKIP       = 421
	NO_LB           = 422
	NO_DROP_SUPPORT = 441

	// os.Exit value
	CLIENT_ERROR = 1
	SERVER_ERROR = 2

	StatusErrorString = "rpc error"
)

Variables

This section is empty.

Functions

func GetError

func GetError(status *dpdkproto.Status, ignoredErrors [][]uint32) error

Ignore requested status errors

func Ignore

func Ignore(errorCodes ...uint32) []uint32

Create array of status error codes to be ignored

func IgnoreStatusErrorCode

func IgnoreStatusErrorCode(err error, errorCodes ...uint32) error

func IsStatusErrorCode

func IsStatusErrorCode(err error, errorCodes ...uint32) bool

Types

type StatusError

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

func NewStatusError

func NewStatusError(errorCode uint32, message string) *StatusError

func (*StatusError) Error

func (s *StatusError) Error() string

func (*StatusError) ErrorCode

func (s *StatusError) ErrorCode() uint32

func (*StatusError) Message

func (s *StatusError) Message() string

Jump to

Keyboard shortcuts

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