errcode

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success                           = NewError(1000, "成功")
	OK                                = NewError(1001, "成功")
	ServerError                       = NewError(1002, "服务内部错误")
	InvalidParams                     = NewError(1003, "入参错误")
	NotFound                          = NewError(1004, "查询资源不存在")
	UnauthorizedAuthNotExist          = NewError(1005, "鉴权失败,找不到对应的AppKey和AppSecret")
	UnauthorizedTokenError            = NewError(1006, "鉴权失败,Token错误")
	UnauthorizedTokenTimeout          = NewError(1007, "鉴权失败,Token超时")
	UnauthorizedTokenGenerate         = NewError(1008, "鉴权失败,Token生成失败")
	UnauthorizedTokenSignatureInvalid = NewError(1009, "鉴权失败,Token签名异常")
	TooManyRequests                   = NewError(1010, "请求过多")
)
View Source
var (
	ErrorService                = NewError(20000, "服务异常,请稍后重试")
	ErrorUserRecordNotFound     = NewError(20001, "查询用户不存在")
	ErrorPlatformRecordNotFound = NewError(20002, "查询平台不存在")
	ErrorUserPhoneExists        = NewError(20003, "当前手机号已绑定账户")
	ErrorUserEmailExists        = NewError(20004, "当前邮箱已绑定账户")
	ErrorUserNameExists         = NewError(20005, "当前用户名已绑定账户")
	ErrorUserAuth               = NewError(20006, "用户验证失败, 请输入正确的账号和密码")
	ErrorUnknownService         = NewError(29999, "未知的服务异常,请联系负责人排查异常")
)

Functions

This section is empty.

Types

type Error

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

func NewError

func NewError(code int, msg string) *Error

func (*Error) Code

func (e *Error) Code() int

func (*Error) Details

func (e *Error) Details() []string

func (*Error) Error

func (e *Error) Error() string

func (*Error) Msg

func (e *Error) Msg() string

func (*Error) Msgf

func (e *Error) Msgf(args []interface{}) string

func (*Error) StatusCode

func (e *Error) StatusCode() int

func (*Error) WithDetails

func (e *Error) WithDetails(details ...string) *Error

Jump to

Keyboard shortcuts

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