errs

package
v0.0.0-...-1ca43b3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OK                  = 0
	ConfigErrorCode     = 100
	MsgErrorCode        = 200
	ConnectionErrorCode = 300
	TimerErrorCode      = 400

	RoomUnexistErrorCode     = 10000
	PlayerNotInRoomErrorCode = 10001
	ParamsErrorCode          = 10002
)
View Source
const (
	FrameworkError = iota
	BusinuessError
)

Variables

View Source
var (
	ConfigError           = NewFrameworkError(ConfigErrorCode, "config error")
	MsgError              = NewFrameworkError(MsgErrorCode, "msg error")
	ConnectionClosedError = NewFrameworkError(ConnectionErrorCode, "connection closed")
	TimerTickError        = NewFrameworkError(TimerErrorCode, "invalid tick")
	TimerBucketError      = NewFrameworkError(TimerErrorCode, "invalid bucketNum")
	TimerTaskRepeatError  = NewFrameworkError(TimerErrorCode, "task repeat")
	TimerTaskAddError     = NewFrameworkError(TimerErrorCode, "task add error")

	RoomUnexistError     = New(RoomUnexistErrorCode, "room unexist")
	PlayerNotInRoomError = New(PlayerNotInRoomErrorCode, "player not in room")
	RoomIdParamError     = New(ParamsErrorCode, "roomid empty")
	PlayerIdParamError   = New(ParamsErrorCode, "playerid empty")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int32
	Type    int
	Message string
	// contains filtered or unexported fields
}

func New

func New(code int32, msg string) *Error

func NewFrameworkError

func NewFrameworkError(code int32, msg string) *Error

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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