moerr

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 0 is OK.
	SUCCESS = iota
	INFO
	WARN

	// Group 1: Internal errors
	ERROR_START = 1000 + iota
	INTERNAL_ERROR
	NYI
	ERROR_FUNCTION_PARAMETER

	// Group 2: numeric
	DIVIVISION_BY_ZERO = 2000 + iota
	OUT_OF_RANGE
	INVALID_ARGUMENT

	// Group 3: invalid input
	BAD_CONFIGURATION = 3000 + iota
	INVALID_INPUT

	// Group 4: unexpected state
	INVALID_STATE = 4000 + iota

	// group 5: rpc timeout
	// ErrRPCTimeout rpc timeout
	ErrRPCTimeout = 5000 + iota
	// ErrClientClosed rpc client closed
	ErrClientClosed
	// ErrBackendClosed backend closed
	ErrBackendClosed
	// ErrStreamClosed rpc stream closed
	ErrStreamClosed
	// ErrNoAvailableBackend no available backend
	ErrNoAvailableBackend

	// Group 10: txn
	// ErrTxnAborted read and write a transaction that has been rolled back.
	ErrTxnClosed = 10000 + iota
	// ErrTxnWriteConflict write conflict error for concurrent transactions
	ErrTxnWriteConflict
	// ErrMissingTxn missing transaction error
	ErrMissingTxn
	// ErrUnreslovedConflict read transaction encounters unresloved data
	ErrUnreslovedConflict
	// ErrTxnError TxnError wrapper
	ErrTxnError
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int32
	Message string
}

func NewError

func NewError(code int32, msg string) *Error

func NewInfo

func NewInfo(msg string) *Error

func NewInternalError

func NewInternalError(msg string, args ...interface{}) *Error

func NewPanicError

func NewPanicError(v interface{}) *Error

Convert a runtime panic to internal error.

func NewWarn

func NewWarn(msg string) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Ok

func (e *Error) Ok() bool

Jump to

Keyboard shortcuts

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