cerrors

package
v0.0.1-fsck Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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