jkerr

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrEqual

func IsErrEqual(err1, err2 error) bool

func IsItfErr

func IsItfErr(err error) bool

Types

type JKErr

type JKErr interface {
	error
	Is(error) bool
	Wrap(error) JKErr
	ErrCode() JKErrorCode
	String() string
	IsErrEqual(err error) bool
}

func New

func New(code JKErrorCode, format string, args ...interface{}) JKErr

type JKError

type JKError struct {
	Code JKErrorCode
	Err  error
	Msg  string

	Stack *stacker
}

func (*JKError) ErrCode

func (j *JKError) ErrCode() JKErrorCode

func (*JKError) Error

func (j *JKError) Error() string

func (*JKError) Format

func (j *JKError) Format(st fmt.State, verb rune)

func (*JKError) Is

func (j *JKError) Is(err error) bool

func (*JKError) IsErrEqual

func (j *JKError) IsErrEqual(err2 error) bool

func (*JKError) String

func (j *JKError) String() string

func (*JKError) Wrap

func (j *JKError) Wrap(err error) JKErr

type JKErrorCode

type JKErrorCode int
const (
	UnknownErr       JKErrorCode = -1
	InitParseFailed  JKErrorCode = 10001
	InitParamTypeErr JKErrorCode = 20001
	ExceptObject     JKErrorCode = 20002

	PathIllegalErr JKErrorCode = 30001
	IterAllKeyErr  JKErrorCode = 30002
	ExcludePathErr JKErrorCode = 30003
)

func GetErrCode

func GetErrCode(err error) JKErrorCode

func (JKErrorCode) String

func (i JKErrorCode) String() string

Jump to

Keyboard shortcuts

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