ecode

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(err error) int

Code read code from _em

func Info

func Info(err error) (int, string)

Info 获取错误信息

func Message

func Message(err error) string

Message 给开发者看的错误信息

func ShowOriginError

func ShowOriginError()

func Tips

func Tips(err error) string

Tips 返回给客户端用户看的错误信息

Types

type E

type E struct {
	// contains filtered or unexported fields
}

E implement Error interface

func New

func New(code int, msg string, tip ...string) *E

New 添加一个不会标准输出的 error

func NewStd

func NewStd(code int, msg string, tip ...string) *E

NewStd 添加一个会标准输出的 error

func (*E) Clone

func (e *E) Clone() E

func (*E) Error

func (e *E) Error() string

Error return code in string form

func (*E) Format

func (e *E) Format(args ...interface{}) *E

func (*E) FormatTips

func (e *E) FormatTips(args ...interface{}) *E

func (*E) SetMsg

func (e *E) SetMsg(msg string) *E

Jump to

Keyboard shortcuts

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