log if we can't even respond
This commit is contained in:
parent
2ed676acf4
commit
8a0d5f0489
@ -158,12 +158,15 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
||||
// TODO: handle error better
|
||||
if err := handler(ctx, request, response); err != nil {
|
||||
// write an error response
|
||||
rcodec.Write(&codec.Message{
|
||||
err = rcodec.Write(&codec.Message{
|
||||
Header: msg.Header,
|
||||
Error: err.Error(),
|
||||
Type: codec.Error,
|
||||
}, nil)
|
||||
|
||||
// could not write the error response
|
||||
if err != nil {
|
||||
log.Logf("rpc: unable to write error response: %v", err)
|
||||
}
|
||||
s.wg.Done()
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user