mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Replace HTTP code with gRPC code in GetHealth API endpoint (#8249)
* Replace HTTP code with gRPC code in GetHealth API endpoint * gazelle Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
@@ -3,7 +3,6 @@ package nodev1
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"runtime"
|
||||
|
||||
ptypes "github.com/gogo/protobuf/types"
|
||||
@@ -11,6 +10,7 @@ import (
|
||||
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1"
|
||||
"github.com/prysmaticlabs/prysm/shared/version"
|
||||
"go.opencensus.io/trace"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
@@ -64,5 +64,5 @@ func (ns *Server) GetHealth(ctx context.Context, _ *ptypes.Empty) (*ptypes.Empty
|
||||
if ns.SyncChecker.Syncing() || ns.SyncChecker.Initialized() {
|
||||
return &ptypes.Empty{}, nil
|
||||
}
|
||||
return &ptypes.Empty{}, status.Error(http.StatusInternalServerError, "node not initialized or having issues")
|
||||
return &ptypes.Empty{}, status.Error(codes.Internal, "node not initialized or having issues")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user