errno

package
v0.0.0-...-48d44df Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode                int32 = 0
	ServiceErrCode             int32 = 10001
	ParamErrCode               int32 = 10002
	UserAlreadyExistErrCode    int32 = 10003
	AuthorizationFailedErrCode int32 = 10004
)

Variables

View Source
var (
	Success                = NewErrNo(SuccessCode, "Success")
	ServiceErr             = NewErrNo(ServiceErrCode, "Service is unable to start successfully")
	ParamErr               = NewErrNo(ParamErrCode, "Wrong Parameter has been given")
	UserAlreadyExistErr    = NewErrNo(UserAlreadyExistErrCode, "User already exists")
	AuthorizationFailedErr = NewErrNo(AuthorizationFailedErrCode, "Authorization failed")
)

Functions

func MConvertErr

func MConvertErr(err error) map[string]interface{}

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) WithMessage

func (e ErrNo) WithMessage(msg string) ErrNo

Jump to

Keyboard shortcuts

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