errorx

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDescription

func FormatDescription(s string, args ...interface{}) string

FormatDescription replace the placeholder in coder.Description Example: Description: call service [service_name] api [api_name] error, args: basic-service, create => Description: call service [basic-service] api [create] error,

func FormatInvalidParamterDetailDescription

func FormatInvalidParamterDetailDescription(s string, args ...interface{}) string

func FormatStringDescription

func FormatStringDescription(s string, args ...interface{}) string

func Is

func Is(erra, errb error) bool

Is 比较两个err是不是同一个err

func IsCode

func IsCode(err error) bool

IsCode 判断是不是errorcode error

Types

type BatchError

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

func (*BatchError) Add

func (be *BatchError) Add(errs ...error)

func (*BatchError) Err

func (be *BatchError) Err() error

Err returns an error that represents all errors.

func (*BatchError) NotNil

func (be *BatchError) NotNil() bool

type ErrorCodeInfo

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

func (*ErrorCodeInfo) Desc

func (e *ErrorCodeInfo) Desc(args ...any) error

func (*ErrorCodeInfo) Detail

func (e *ErrorCodeInfo) Detail(err any, args ...any) error

func (*ErrorCodeInfo) Err

func (e *ErrorCodeInfo) Err() error

func (*ErrorCodeInfo) GetCode

func (e *ErrorCodeInfo) GetCode() string

type Module

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

func New

func New(preCode string) *Module

func (*Module) Cause

func (m *Module) Cause(code, desc, cause string) *ErrorCodeInfo

Cause 该方法还必须在Module方法之后

func (*Module) Description

func (m *Module) Description(code, desc string) *ErrorCodeInfo

Description 该方法还必须在Module方法之后

func (*Module) Solution

func (m *Module) Solution(code, desc, cause, solution string) *ErrorCodeInfo

Solution 该方法还必须在Module方法之后

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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