This commit is contained in:
crusader 2018-04-10 15:21:42 +09:00
parent 06ea44929a
commit 0842585db2

View File

@ -76,6 +76,10 @@ func (s *RESTServlets) HandleGet(servletCtx server.ServletCtx, ctx *fasthttp.Req
reply, err := s.RPCInvoker.Invoke(reqCodec, servletCtx, ctx) reply, err := s.RPCInvoker.Invoke(reqCodec, servletCtx, ctx)
if nil == reply && nil == err {
return nil
}
buf, err := reqCodec.NewResponseWithString(reply.(string), err) buf, err := reqCodec.NewResponseWithString(reply.(string), err)
if nil != err { if nil != err {
return csw.NewError(fasthttp.StatusInternalServerError, err) return csw.NewError(fasthttp.StatusInternalServerError, err)
@ -99,6 +103,10 @@ func (s *RESTServlets) HandlePost(servletCtx server.ServletCtx, ctx *fasthttp.Re
reply, err := s.RPCInvoker.Invoke(reqCodec, servletCtx, ctx) reply, err := s.RPCInvoker.Invoke(reqCodec, servletCtx, ctx)
if nil == reply && nil == err {
return nil
}
buf, err = reqCodec.NewResponseWithString(reply.(string), err) buf, err = reqCodec.NewResponseWithString(reply.(string), err)
if nil != err { if nil != err {
return csw.NewError(fasthttp.StatusInternalServerError, err) return csw.NewError(fasthttp.StatusInternalServerError, err)