This commit is contained in:
crusader 2018-04-10 12:53:46 +09:00
parent 28a86a9282
commit 63fa257178

View File

@ -60,9 +60,9 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
if nil != _clientType && nil != _sessionID && nil != _targetID {
md = metadata.Pairs(
og.GRPCClientTypeKey, _clientType.(og.ClientType).String(),
og.GRPCSessionIDKey, _sessionID.(string),
og.GRPCTargetIDKey, _targetID.(string),
og.GRPCClientTypeKey.String(), _clientType.(og.ClientType).String(),
og.GRPCSessionIDKey.String(), _sessionID.(string),
og.GRPCTargetIDKey.String(), _targetID.(string),
)
}
@ -77,15 +77,15 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
// grpc exec method call
src, err = sc.NewRequest(msg)
if nil != err {
logging.Logger().Errore(err)
logging.Logger().Error(err)
break
}
method = src.Method()
params, err = src.Params()
if nil != err {
logging.Logger().Errore(err)
s.writeError(crp.E_BAD_PARAMS, "", err)
logging.Logger().Error(err)
s.writeError(src, writeChan, crp.E_BAD_PARAMS, "", err)
break
}
@ -93,8 +93,8 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
grpcReply, err = ogeg.Exec(grpcCtx, method, params...)
replyBuff, err = src.NewResponseWithString(grpcReply, err)
if nil != err {
logging.Logger().Errore(err)
s.writeError(crp.E_INTERNAL, "", err)
logging.Logger().Error(err)
s.writeError(src, writeChan, crp.E_INTERNAL, "", err)
break
}
@ -107,7 +107,7 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
}
func (s *RPCServlets) writeError(src crp.ServerRequestCodec, writeChan chan<- []byte, code int, message string, data interface{}) {
func (s *RPCServlets) writeError(src crp.ServerRequestCodec, writeChan chan<- []byte, code crp.ErrorCode, message string, data interface{}) {
if !src.HasResponse() {
return
}
@ -120,7 +120,7 @@ func (s *RPCServlets) writeError(src crp.ServerRequestCodec, writeChan chan<- []
buf, err := src.NewResponse(nil, pErr)
if nil != err {
logging.Logger().Errore(err)
logging.Logger().Error(err)
return
}
writeChan <- buf