error

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 5 Imported by: 40

Documentation

Index

Constants

View Source
const (
	ServerError   = 500
	BusinessError = 5001
	Success       = 200
)

Variables

This section is empty.

Functions

func CodeToMessage

func CodeToMessage(code int) string

func InjectCodeMessage

func InjectCodeMessage(m map[int]string)

Types

type Error

type Error interface {
	Error() string
	ErrorType() int
	Code() int
	Msg() string
	HttpCode() int
	String() string
	Encode() error
}

func DecodeError added in v0.1.9

func DecodeError(err error) Error

func NewBusinessError

func NewBusinessError(code int, msg string, err error) Error

func NewError

func NewError(code int, msg string, err error, errType int) Error

func NewServerError

func NewServerError(code int, msg string, err error) Error

Jump to

Keyboard shortcuts

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