diff --git a/server/server.go b/server/server.go index 85b2b3af..5b74850a 100644 --- a/server/server.go +++ b/server/server.go @@ -7,6 +7,7 @@ import ( "net/http" "time" + "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/recovery" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/soheilhy/cmux" @@ -118,6 +119,8 @@ func (s *Server) newGRPCServer() *grpc.Server { // Create the gRPC server opts := []grpc.ServerOption{ grpc.StatsHandler(otelgrpc.NewServerHandler()), + grpc.UnaryInterceptor(recovery.UnaryServerInterceptor()), + grpc.StreamInterceptor(recovery.StreamServerInterceptor()), } grpcServer := grpc.NewServer(opts...)