1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-08-10 21:52:01 +02:00

Temporary stop gap for panicking server handlers

This commit is contained in:
Asim
2015-11-24 00:52:59 +00:00
parent 5d88115f2a
commit 469b12ecea
2 changed files with 37 additions and 3 deletions

View File

@@ -53,7 +53,11 @@ func (s *rpcServer) accept(sock transport.Socket) {
delete(hdr, "Content-Type")
ctx := c.WithMetadata(context.Background(), hdr)
s.rpc.ServeRequestWithContext(ctx, codec)
// TODO: needs better error handling
if err := s.rpc.ServeRequestWithContext(ctx, codec); err != nil {
log.Errorf("Unexpected error servinc request, closing socket: %v", err)
sock.Close()
}
}
func (s *rpcServer) Config() options {