diff --git a/client/client.go b/client/client.go index e933c8b..3f281fd 100644 --- a/client/client.go +++ b/client/client.go @@ -315,7 +315,7 @@ func (c *client) rpcWriter(stopChan <-chan struct{}, writerDone chan<- error) { } err = fmt.Errorf("Client: Cannot send request to wire: [%s]", err) - logging.Logger().Error(err.Error()) + logging.Logger().Error(err) continue } } @@ -343,8 +343,7 @@ func (c *client) rpcReader(readerDone chan<- error) { logging.Logger().Infof("Client: disconnected from server") return } - err = fmt.Errorf("Client: Cannot decode response or notify: [%s]", err) - logging.Logger().Error(err.Error()) + logging.Logger().Errorf("Client: Cannot decode response or notify: [%s]", err) continue } diff --git a/protocol/json/client_notification.go b/protocol/json/client_notification.go index d65a9a1..0c96da2 100644 --- a/protocol/json/client_notification.go +++ b/protocol/json/client_notification.go @@ -26,6 +26,10 @@ type ClientNotificationCodec struct { codec codec.Codec } +func (cnc *ClientNotificationCodec) HasResponse() bool { + return false +} + func (cnc *ClientNotificationCodec) Method() string { return cnc.noti.Method } diff --git a/protocol/registry_codec.go b/protocol/registry_codec.go index b0ecc68..88adc7e 100644 --- a/protocol/registry_codec.go +++ b/protocol/registry_codec.go @@ -10,4 +10,6 @@ type RegistryCodec interface { // Reads the request filling the RPC method args. ReadParams(args []interface{}) error Params() ([]string, error) + + HasResponse() bool } diff --git a/protocol/server_codec.go b/protocol/server_codec.go index 219af30..92f98de 100644 --- a/protocol/server_codec.go +++ b/protocol/server_codec.go @@ -15,7 +15,6 @@ type ServerCodec interface { type ServerRequestCodec interface { RegistryCodec - HasResponse() bool WriteResponse(w io.Writer, reply interface{}) error WriteError(w io.Writer, status int, err error) error }