errors

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnknownError = &Status{Code: 10000, Message: "未知错误"}

Functions

func GetCodeMessage

func GetCodeMessage(e error) (int, string)

Types

type Code

type Code int

type Error

type Error struct {
	Status   *Status
	Original error
}

func New

func New(status *Status, originals ...error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetStatus

func (e *Error) GetStatus() *Status

type Status

type Status struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func GetStatus

func GetStatus(e error) *Status

func (*Status) FmtMsg

func (status *Status) FmtMsg(val ...interface{}) *Status

Jump to

Keyboard shortcuts

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