errorx

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAPINotFound      = NewSysError(404, "接口不存在")
	ErrAPIUnauthorized  = NewSysError(401, "身份认证失败")
	ErrNonLogin         = NewSysError(402, "用户未登录")
	ErrAPIForbidden     = NewSysError(403, "接口未经授权")
	ErrInvalidParameter = NewSysError(700, "无效参数")
	ErrMissingParameter = NewSysError(701, "缺少参数")
	ErrBadParameter     = NewSysError(702, "请求参数校验不通过")
)

Functions

This section is empty.

Types

type SysError

type SysError struct {
	Code int
	// contains filtered or unexported fields
}

SysError 定义系统异常

func NewSysError

func NewSysError(code int, text string) *SysError

NewSysError 创建一个系统异常

func (*SysError) Error

func (e *SysError) Error() string

Error 实现Error()接口函数

Jump to

Keyboard shortcuts

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