Skip to content

Commit

Permalink
removed test code
Browse files Browse the repository at this point in the history
  • Loading branch information
nr-swilloughby committed Jul 8, 2021
1 parent 0efa74c commit b5d08f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions v3/integrations/nrgrpc/example/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (
sampleapp "github.com/newrelic/go-agent/v3/integrations/nrgrpc/example/sampleapp"
newrelic "github.com/newrelic/go-agent/v3/newrelic"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

// Server is a gRPC server.
Expand All @@ -30,8 +28,7 @@ func processMessage(ctx context.Context, msg *sampleapp.Message) {
// DoUnaryUnary is a unary request, unary response method.
func (s *Server) DoUnaryUnary(ctx context.Context, msg *sampleapp.Message) (*sampleapp.Message, error) {
processMessage(ctx, msg)
// return &sampleapp.Message{Text: "Hello from DoUnaryUnary"}, nil
return &sampleapp.Message{}, status.New(codes.DataLoss, "oooooops!").Err()
return &sampleapp.Message{Text: "Hello from DoUnaryUnary"}, nil
}

// DoUnaryStream is a unary request, stream response method.
Expand Down
2 changes: 1 addition & 1 deletion v3/integrations/nrgrpc/nrgrpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func ErrorInterceptorStatusHandler(ctx context.Context, txn *newrelic.Transactio
txn.SetWebResponse(nil).WriteHeader(int(codes.OK))
txn.NoticeError(&newrelic.Error{
Message: s.Message(),
Class: "gRPC Error: " + s.Code().String(),
Class: "gRPC Status: " + s.Code().String(),
})
txn.AddAttribute("GrpcStatusLevel", "error")
txn.AddAttribute("GrpcStatusMessage", s.Message())
Expand Down

0 comments on commit b5d08f3

Please sign in to comment.