Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorType_name = map[int32]string{
0: "OK",
100000: "CUSTOM_ERROR",
100001: "SERVER_INTERNAL_ERROR",
100002: "SERVER_CDATA_ERROR",
100003: "SERVER_CMSG_ERROR",
100004: "SERVER_FILE_NOT_FOUND",
100005: "SERVER_ACCESS_REFUSED",
200000: "CLIENT_TIMEOUT",
200001: "CLIENT_IO_ERROR",
}
View Source
var RecoverPanicToErr = true
Functions ¶
func EnumName ¶
EnumName is a helper function to simplify printing enums by name. Given an enum map and a value, it returns a useful string.
func IsCustomError ¶
判断错误类型是否是允许的错误范围 true=消息内部定义的错误,false=系统级别错误,需要关闭连接
func PanicToErr ¶
func PanicToErr(err *error)
func PanicValToErr ¶
func PanicValToErr(panicVal interface{}, err *error)
Types ¶
type ErrorType ¶
type ErrorType int32
const ( //操作成功的返回码常量 OK ErrorType = 0 //通用错误 CUSTOM_ERROR ErrorType = 100000 //服务器端一般错误 SERVER_INTERNAL_ERROR ErrorType = 100001 //读取客户端发送的数据异常 SERVER_CDATA_ERROR ErrorType = 100002 //处理客户端发送的数据异常 SERVER_CMSG_ERROR ErrorType = 100003 //服务器端的文件没有找到 SERVER_FILE_NOT_FOUND ErrorType = 100004 //服务器端的访问被拒绝 SERVER_ACCESS_REFUSED ErrorType = 100005 //客户端访问超时 CLIENT_TIMEOUT ErrorType = 200000 //客户端IO错误 CLIENT_IO_ERROR ErrorType = 200001 )
Click to show internal directories.
Click to hide internal directories.