refactor(error): 重构错误处理机制,使用ErrorCode枚举替代OutInfo接口
This commit is contained in:
@@ -2,6 +2,7 @@ package controller
|
||||
|
||||
import (
|
||||
"blazing/common/data/entity"
|
||||
"blazing/common/socket/errorcode"
|
||||
"blazing/common/socket/handler"
|
||||
"blazing/cool"
|
||||
"blazing/logic/service"
|
||||
@@ -208,13 +209,13 @@ func Recv(c *entity.Conn, data handler.TomeeHeader) {
|
||||
return
|
||||
}
|
||||
|
||||
aa, ok := ret[1].Interface().(service.OutInfo) //判断错误
|
||||
aa, ok := ret[1].Interface().(errorcode.ErrorCode) //判断错误
|
||||
|
||||
if ok && aa != nil { //这里实现回复错误包
|
||||
if ok && aa != 0 { //这里实现回复错误包
|
||||
|
||||
cool.Loger.Error(context.Background(), aa.Error(), aa.Code())
|
||||
cool.Loger.Error(context.Background(), aa.Code())
|
||||
|
||||
data.Result = uint32(aa.Code())
|
||||
data.Result = uint32(aa)
|
||||
c.SendPack(data.Pack(nil))
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user