errno

package
v0.0.0-...-f9b5f64 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode                = 0
	ServiceErrCode             = 10001
	ParamErrCode               = 10002
	UserAlreadyExistErrCode    = 10003
	AuthorizationFailedErrCode = 10004
	RpcConnectErrCode          = 10005
	UploadVideoErrCode         = 10006
	ErrDatabaseCode            = 10007
)

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")
	RpcConnectErr          = NewErrNo(RpcConnectErrCode, "Rpc Connect failed")
	UploadVideoErr         = NewErrNo(UploadVideoErrCode, "Upload Video failed")
	ErrDatabase            = NewErrNo(ErrDatabaseCode, "Database error")
)

Functions

func Dprintf

func Dprintf(format string, args ...interface{})

Types

type ErrNo

type ErrNo struct {
	ErrCode int64
	ErrMsg  string
}

func ConvertErr

func ConvertErr(err error) ErrNo

ConvertErr convert error to Errno

func NewErrNo

func NewErrNo(code int64, 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