errcode

package
v0.0.0-...-e046c8a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success                   = NewError(0, "成功")
	ServerError               = NewError(10000000, "服务内部错误")
	InvalidParams             = NewError(10000001, "入参错误")
	NotFound                  = NewError(10000002, "找不到")
	UnauthorizedAuthNotExist  = NewError(10000003, "鉴权失败,找不到对应的 AppKey 和 AppSecret")
	UnauthorizedTokenError    = NewError(10000004, "鉴权失败,Token 错误")
	UnauthorizedTokenTimeout  = NewError(10000005, "鉴权失败,Token 超时")
	UnauthorizedTokenGenerate = NewError(10000006, "鉴权失败,Token 生成失败")
	TooManyRequests           = NewError(10000007, "请求过多")
	UnauthorizedApiError      = NewError(10000008, "鉴权失败,API没有访问权限")
)
View Source
var (
	ErrorUserUsernameNotExist  = NewError(20010000, "账号不存在")
	ErrorUserAccountIsDisabled = NewError(20010001, "账号已禁用")
	ErrorUserAccountIsDelete   = NewError(20010002, "账号已删除")
	ErrorUserAccountIsLocked   = NewError(20010003, "账号已锁定")

	ErrorUsersCheckMobileIsNo = NewError(200100000, "手机号不存在")
	ErrorUsersSendCodeFail    = NewError(200100020, "手机验证码发送失败")
	ErrorUsersCodeFault       = NewError(200100030, "验证码错误")
	ErrorUsersCodeOverdue     = NewError(200100040, "验证码已过期")
	ErrorUsersCodeStatus      = NewError(200100050, "验证码还在有效期内,请勿多次申请")
)

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