errs

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Err

type Err struct {
	State     int         //异常的状态码, 0:无异常
	Data      interface{} //异常相关的参数
	Message   string      //消息
	Pkg       string
	Module    string //异常的模块
	Err       error  //被wrap的异常
	UserError bool   //是否是用户异常,否则是系统异常
}

func NewUserError

func NewUserError(state int, msg string) *Err

func (Err) Error

func (e Err) Error() string

func (Err) Result

func (e Err) Result() Result

func (Err) String

func (e Err) String() string

type Result

type Result struct {
	State   int
	Data    interface{} `json:"Data,omitempty"`
	Message string      `json:"Message,omitempty"`
	Pkg     string      `json:"Pkg,omitempty"`
	Module  string      `json:"Module,omitempty"`
}

Jump to

Keyboard shortcuts

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