bizerr

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success           = &BizErr{0, "success"}
	Param             = &BizErr{1, "params error"}
	Request           = &BizErr{1, "request error"}
	DebounceIntercept = &BizErr{2, "busy service"}
	RestyHttp         = &BizErr{3, "http request the third party services error"}
	Unauthorized      = &BizErr{401, "unauthorized"}
	Forbidden         = &BizErr{401, "forbidden permissions"}
	Unknown           = &BizErr{500, "unknown error"}
)

服务错误定义

Functions

func Code

func Code(err error) int

func Is

func Is(err, target error) bool

func IsBizErr

func IsBizErr(err error) bool

Types

type BizErr

type BizErr struct {
	Code int
	Msg  string
}

func New

func New(code int, msg string) *BizErr

func (*BizErr) Error

func (b *BizErr) Error() string

Jump to

Keyboard shortcuts

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