处理错误码
This commit is contained in:
parent
8e8f145bbc
commit
7dca2bdfae
10
lib/robot.go
10
lib/robot.go
@ -127,8 +127,14 @@ func (r *Robot) SendMsg(mainType, subType string, req proto.Message, rsp proto.M
|
|||||||
if !ProtoUnmarshal(msg, rsp) {
|
if !ProtoUnmarshal(msg, rsp) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return pb.ErrorCode_Success
|
return pb.ErrorCode_Success
|
||||||
|
} else if msg.MainType == "notify" && msg.SubType == "errornotify" {
|
||||||
|
rsp := &pb.NotifyErrorNotifyPush{}
|
||||||
|
if !ProtoUnmarshal(msg, rsp) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
logrus.Info(rsp.Code)
|
||||||
|
return rsp.Code
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -224,7 +230,7 @@ func (m *Robot) syncCall() {
|
|||||||
//这里执行会花很长时间
|
//这里执行会花很长时间
|
||||||
if err := scene.Run(m); err != nil {
|
if err := scene.Run(m); err != nil {
|
||||||
logrus.WithField("err", err).Error("执行业务时发生错误")
|
logrus.WithField("err", err).Error("执行业务时发生错误")
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
elapsedTime := time.Since(start)
|
elapsedTime := time.Since(start)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user