cerrors

package
v4.7.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 3 Imported by: 64

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChapiError

type ChapiError struct {
	Code ChapiErrorCode `json:"code"`
	Text string         `json:"text,omitempty"`
}

func NewChapiError

func NewChapiError(args ...interface{}) *ChapiError

NewChapiError takes an array of objects and returns a pointer to a ChapiError object. The following input parameters, in any order, are supported:

ChapiError     - ChapiError object
error          - All other error objects
ChapiErrorCode - CHAPI error code
string         - CHAPI error text

This routine parses the input data to create and return a new ChapiError object

func NewChapiErrorf

func NewChapiErrorf(c ChapiErrorCode, format string, a ...interface{}) *ChapiError

func (*ChapiError) Error

func (e *ChapiError) Error() string

func (*ChapiError) ErrorCode

func (e *ChapiError) ErrorCode() ChapiErrorCode

Code returns the status code contained in ChapiError

func (*ChapiError) ErrorText

func (e *ChapiError) ErrorText() string

ErrorText returns the text contained in ChapiError

func (*ChapiError) LogAndError

func (e *ChapiError) LogAndError() ChapiError

type ChapiErrorCode

type ChapiErrorCode uint32
const (
	OK                ChapiErrorCode = 0
	Canceled          ChapiErrorCode = 1
	Unknown           ChapiErrorCode = 2
	InvalidArgument   ChapiErrorCode = 3
	NotFound          ChapiErrorCode = 4
	AlreadyExists     ChapiErrorCode = 5
	PermissionDenied  ChapiErrorCode = 6
	ResourceExhausted ChapiErrorCode = 7
	Aborted           ChapiErrorCode = 8
	Unimplemented     ChapiErrorCode = 9
	Internal          ChapiErrorCode = 10
	DataLoss          ChapiErrorCode = 11
	Unauthenticated   ChapiErrorCode = 12
	Timeout           ChapiErrorCode = 13
	ConnectionFailed  ChapiErrorCode = 14
)

func (ChapiErrorCode) String

func (c ChapiErrorCode) String() string

Jump to

Keyboard shortcuts

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