err1

package
v0.0.0-...-c3ec36b Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallInfo

func CallInfo(skip int) string

获取堆栈信息字符串=>文件名:行数 方法名称 如果没有结果返回 ???:- ???

func MsgPackRegister

func MsgPackRegister(id int8)

func PrintCaller

func PrintCaller() string

打印堆栈信息

Types

type CallerInfo

type CallerInfo struct {
	FuncName string
	FileName string
	FileLine int
}

func Caller

func Caller() []CallerInfo

获取代码调用堆栈

type Error

type Error interface {
	json.Marshaler
	Code() int64                      //自定义错误编码
	Msg() string                      //自定义错误消息
	Err() error                       //具体的错误
	Caller() string                   //返回调用堆栈信息
	Error() string                    //继承全局的error接口
	Format(args ...interface{}) Error //格式化错误
}

Error 错误接口

func NewError

func NewError(code int64, msg string, errs ...error) Error

NewError 新建错误

Jump to

Keyboard shortcuts

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