errcode

package
v0.0.0-...-15b0c83 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 1 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和AppSerrcoderet")
	UnauthorizedTokenError    = NewError(10000004, "鉴权失败,Token错误")
	UnauthorizedTokenTimeout  = NewError(10000005, "鉴权失败,Token超时")
	UnauthorizedTokenGenerate = NewError(10000006, "鉴权失败,Token生成失败")
	TooManyRequests           = NewError(10000007, "请求过多")
)

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() []map[string]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) WithDetail

func (e *Error) WithDetail(key, val string) *Error

Jump to

Keyboard shortcuts

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