_2generate_n_stringer

package
v0.0.0-...-a7c7adb Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomError

type CustomError struct {
	Code errcode.ErrCode // 业务码
	// contains filtered or unexported fields
}

CustomError 1、错误时返回自定义结构r结构体,并重写Error()方法

func (*CustomError) Error

func (e *CustomError) Error() string

func (*CustomError) GetErrCode

func (e *CustomError) GetErrCode() uint32

GetErrCode 返回给前端的错误码

func (*CustomError) GetErrMsg

func (e *CustomError) GetErrMsg() string

GetErrMsg 返回给前端显示端错误信息

type Xerror

type Xerror interface {
	GetErrCode() uint32
	GetErrMsg() string
	error
}

func NewErrCode

func NewErrCode(errCode errcode.ErrCode) Xerror

func NewErrCodeMsg

func NewErrCodeMsg(errCode errcode.ErrCode, errMsg string) Xerror

func NewErrMsg

func NewErrMsg(errMsg string) Xerror

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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