Return service name in error

This commit is contained in:
Asim Aslam 2020-08-08 09:09:34 +01:00 committed by Vasiliy Tolstov
parent 522e04840c
commit 3703769758

View File

@ -193,7 +193,7 @@ func (g *grpcServer) handler(srv interface{}, stream grpc.ServerStream) (err err
logger.Error("panic recovered: ", r) logger.Error("panic recovered: ", r)
logger.Error(string(debug.Stack())) logger.Error(string(debug.Stack()))
} }
err = errors.InternalServerError("go.micro.server", "panic recovered: %v", r) err = errors.InternalServerError(g.opts.Name, "panic recovered: %v", r)
} }
}() }()
@ -262,7 +262,7 @@ func (g *grpcServer) handler(srv interface{}, stream grpc.ServerStream) (err err
if g.opts.Router != nil { if g.opts.Router != nil {
cc, err := g.newGRPCCodec(ct) cc, err := g.newGRPCCodec(ct)
if err != nil { if err != nil {
return errors.InternalServerError("go.micro.server", err.Error()) return errors.InternalServerError(g.opts.Name, err.Error())
} }
codec := &grpcCodec{ codec := &grpcCodec{
method: fmt.Sprintf("%s.%s", serviceName, methodName), method: fmt.Sprintf("%s.%s", serviceName, methodName),
@ -362,7 +362,7 @@ func (g *grpcServer) processRequest(stream grpc.ServerStream, service *service,
cc, err := g.newGRPCCodec(ct) cc, err := g.newGRPCCodec(ct)
if err != nil { if err != nil {
return errors.InternalServerError("go.micro.server", err.Error()) return errors.InternalServerError(g.opts.Name, err.Error())
} }
b, err := cc.Marshal(argv.Interface()) b, err := cc.Marshal(argv.Interface())
if err != nil { if err != nil {