client close: rpc: unable to write error response
when client close notice: "rpc: unable to write error response..."
This commit is contained in:
parent
89014160fc
commit
6be205fd40
@ -157,6 +157,7 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
|||||||
|
|
||||||
// TODO: handle error better
|
// TODO: handle error better
|
||||||
if err := handler(ctx, request, response); err != nil {
|
if err := handler(ctx, request, response); err != nil {
|
||||||
|
if err != lastStreamResponseError {
|
||||||
// write an error response
|
// write an error response
|
||||||
err = rcodec.Write(&codec.Message{
|
err = rcodec.Write(&codec.Message{
|
||||||
Header: msg.Header,
|
Header: msg.Header,
|
||||||
@ -167,6 +168,7 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Logf("rpc: unable to write error response: %v", err)
|
log.Logf("rpc: unable to write error response: %v", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
s.wg.Done()
|
s.wg.Done()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user