errs

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUniqueDuplicate = ErrorCode{Code: 500001, Msg: "唯一标识冲突"}
	ErrNotFound        = ErrorCode{Code: 500002, Msg: "数据不存在"}
	SystemError        = ErrorCode{Code: 502001, Msg: "系统错误"}
)

定义统一的错误类型

View Source
var (
	ErrConcurrentUpdate = errors.New("数据已被其他用户修改,请刷新后重试")
)
View Source
var (
	RelationIsNotFountResult = ErrorCode{Code: 501001, Msg: "模型关联关系不为空"}
)
View Source
var (
	RelationMappingConstraint = ErrorCode{Code: 501002, Msg: "资源关联关系不符合模型映射约束"}
)
View Source
var (
	UrlPathError = ErrorCode{Code: 503001, Msg: "URL PATH 传递错误"}
)
View Source
var (
	ValidationError = ErrorCode{Code: 503002, Msg: "验证错误"}
)

Functions

This section is empty.

Types

type ErrorCode added in v1.11.1

type ErrorCode struct {
	Code int
	Msg  string
}

func (ErrorCode) Error added in v1.11.1

func (e ErrorCode) Error() string

func (ErrorCode) GetCode added in v1.11.1

func (e ErrorCode) GetCode() int

func (ErrorCode) GetMsg added in v1.11.1

func (e ErrorCode) GetMsg() string

func (ErrorCode) Is added in v1.11.1

func (e ErrorCode) Is(target error) bool

func (ErrorCode) WithMsg added in v1.11.1

func (e ErrorCode) WithMsg(msg string) ErrorCode

Jump to

Keyboard shortcuts

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