This commit is contained in:
crusader 2017-11-30 14:55:48 +09:00
parent 4c113374e9
commit de7d112428
2 changed files with 8 additions and 3 deletions

View File

@ -399,6 +399,14 @@ func (c *client) handleNotification(resCodec protocol.ClientResponseCodec) error
return err return err
} }
if nil == c.ch.GetRPCRegistry() {
params, err := notiCodec.Params()
if nil != err {
return err
}
return fmt.Errorf("Client: Get Notification[method: %s, params: %v]. But RPC registry is not specified", notiCodec.Method(), params)
}
_, err = c.ch.GetRPCRegistry().Invoke(notiCodec) _, err = c.ch.GetRPCRegistry().Invoke(notiCodec)
return err return err

View File

@ -73,9 +73,6 @@ func (ch *ClientHandlers) Validate() {
if nil == ch.Codec { if nil == ch.Codec {
logging.Logger().Panic("RPC Client Handler: Codec must be specified") logging.Logger().Panic("RPC Client Handler: Codec must be specified")
} }
if nil == ch.RPCRegistry {
logging.Logger().Panic("RPC Client Handler: RPCRegistry must be specified")
}
if ch.RequestTimeout <= 0 { if ch.RequestTimeout <= 0 {
ch.RequestTimeout = DefaultRequestTimeout ch.RequestTimeout = DefaultRequestTimeout