errcode

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StatusOK           = NewErr(0, "成功")
	ErrParamsNotValid  = NewErr(1001, "参数有误")
	ErrNotFound        = NewErr(1002, "未找到资源")
	ErrServer          = NewErr(1003, "系统错误")
	ErrTooManyRequests = NewErr(1004, "请求过多")
	ErrTimeOut         = NewErr(1005, "请求超时")
)

以 1 开头表示公共错误码

Functions

This section is empty.

Types

type Err

type Err interface {
	Error() string
	ECode() int
	WithDetails(details ...string) Err
}

func NewErr

func NewErr(code int, msg string) Err

Jump to

Keyboard shortcuts

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