Skip to content

Commit

Permalink
Merge pull request #153 from jackchenjc/issue-134-2
Browse files Browse the repository at this point in the history
fix: Fix the error code statement of Core Keeper client
  • Loading branch information
cloudxxx8 authored Jul 2, 2024
2 parents 345e54d + 3612964 commit b356ead
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/keeper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (k *keeperClient) Register() error {

// check if the service registry exists first
resp, err := k.registryClient.RegistrationByServiceId(context.Background(), k.serviceKey)
if err != nil && resp.StatusCode != http.StatusNotFound {
if err != nil && err.Code() != http.StatusNotFound {
return fmt.Errorf("failed to check the %s service registry status: %v", k.serviceKey, err)
}

Expand Down Expand Up @@ -191,7 +191,7 @@ func (k *keeperClient) GetAllServiceEndpoints() ([]types.ServiceEndpoint, error)
// IsServiceAvailable checks with Keeper if the target service is registered and healthy
func (k *keeperClient) IsServiceAvailable(serviceKey string) (bool, error) {
resp, err := k.registryClient.RegistrationByServiceId(context.Background(), serviceKey)
if err != nil && resp.StatusCode != http.StatusNotFound {
if err != nil && err.Code() != http.StatusNotFound {
return false, fmt.Errorf("failed to get %s service registry: %v", serviceKey, err)
}

Expand Down

0 comments on commit b356ead

Please sign in to comment.