From 7da6ff1c4b9e95311f84e654b3514555166c9300 Mon Sep 17 00:00:00 2001 From: lpxxn Date: Mon, 27 May 2019 13:14:31 +0800 Subject: [PATCH] fix:# #476 need send error info --- server/rpc_server.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/server/rpc_server.go b/server/rpc_server.go index b4924846..4b7ef194 100644 --- a/server/rpc_server.go +++ b/server/rpc_server.go @@ -157,17 +157,15 @@ func (s *rpcServer) ServeConn(sock transport.Socket) { // TODO: handle error better if err := handler(ctx, request, response); err != nil { - if err != lastStreamResponseError { - // write an error response - 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) - } + // write an error response + 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