ing
This commit is contained in:
parent
fccf18a26a
commit
e3a873a067
|
@ -57,6 +57,10 @@ func (srwch *ServletReadWriteCloseHandlers) WriteNotification(servletCTX rpc.Ser
|
|||
return wErr
|
||||
}
|
||||
|
||||
defer func() {
|
||||
wc.Close()
|
||||
}()
|
||||
|
||||
if wErr := codec.WriteNotification(wc, method, params); nil != wErr {
|
||||
return wErr
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.loafle.net/commons_go/logging"
|
||||
"git.loafle.net/commons_go/rpc"
|
||||
"git.loafle.net/commons_go/rpc/protocol"
|
||||
|
@ -16,18 +14,19 @@ type ServletHandlers struct {
|
|||
}
|
||||
|
||||
func (sh *ServletHandlers) Invoke(servletCTX rpc.ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error) {
|
||||
if !sh.RPCInvoker.HasMethod(requestCodec.Method()) {
|
||||
return nil, fmt.Errorf("RPC Servlet Handler: Method[%s] is not exist", requestCodec.Method())
|
||||
}
|
||||
// if !sh.RPCInvoker.HasMethod(requestCodec.Method()) {
|
||||
// return nil, fmt.Errorf("RPC Servlet Handler: Method[%s] is not exist", requestCodec.Method())
|
||||
// }
|
||||
|
||||
result, err = sh.RPCInvoker.Invoke(requestCodec)
|
||||
if nil != err {
|
||||
if params, pErr := requestCodec.Params(); nil != err {
|
||||
logging.Logger().Errorf("RPC Servlet Handler: Read Param of Method[%s] returns error %v", requestCodec.Method(), pErr)
|
||||
} else {
|
||||
logging.Logger().Errorf("RPC Servlet Handler: Method[%s] params[%v] returns error %v", requestCodec.Method(), params, err)
|
||||
}
|
||||
}
|
||||
|
||||
// if nil != err {
|
||||
// params, pErr := requestCodec.Params()
|
||||
// if nil != pErr {
|
||||
// logging.Logger().Errorf("RPC Servlet Handler: Read Param of Method[%s] returns error %v", requestCodec.Method(), pErr)
|
||||
// }
|
||||
// logging.Logger().Errorf("RPC Servlet Handler: Method[%s] params[%v] returns error %v", requestCodec.Method(), params, err)
|
||||
// }
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user