errno

package
v0.0.0-...-3b276ab Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode         = 0
	ParamErrCode        = 1001
	ServiceErrCode      = 1002
	DatabaseErrCode     = 1003
	NilValueErrCode     = 1004
	UnclassifiedErrCode = 1005
)

Variables

View Source
var (
	Success         = NewErrNo(SuccessCode, "Success")
	ParamErr        = NewErrNo(ParamErrCode, "Wrong Parameter has been given")
	ServiceErr      = NewErrNo(ServiceErrCode, "Service is unable to start successfully")
	DatabaseErr     = NewErrNo(DatabaseErrCode, "Error when operate database")
	NilValueErr     = NewErrNo(NilValueErrCode, "Value is nil or doesn't exist")
	UnclassifiedErr = NewErrNo(UnclassifiedErrCode, "Maybe it's an error returned by the framework used")
)

Functions

This section is empty.

Types

type ErrNo

type ErrNo struct {
	ErrCode int32
	ErrMsg  string
}

func ConvertErr

func ConvertErr(err error) ErrNo

func NewErrNo

func NewErrNo(code int32, msg string) ErrNo

func (ErrNo) Error

func (e ErrNo) Error() string

func (ErrNo) WriteMsg

func (e ErrNo) WriteMsg(msg string) ErrNo

Jump to

Keyboard shortcuts

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