errs

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(code codes.Code, msg string) error

New 创建一个error,默认为业务错误类型,提高业务开发效率

func Newf

func Newf(code codes.Code, format string, params ...interface{}) error

Newf 创建一个error,默认为业务错误类型,msg支持格式化字符串

Types

type CatchHandler added in v0.2.0

type CatchHandler interface {
	Catch(e error, handler func(err error)) CatchHandler
	CatchAll(handler func(err error)) FinalHandler
	FinalHandler
}

func Try added in v0.2.0

func Try(f func()) CatchHandler

type FinalHandler added in v0.2.0

type FinalHandler interface {
	Finally(handlers ...func())
}

Jump to

Keyboard shortcuts

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