bizerr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 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"}
	Unauthorized      = &BizErr{401, "unauthorized"}
	Forbidden         = &BizErr{403, "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