diff --git a/artifactory/services/system.go b/artifactory/services/system.go index 2337590c2..3144637f3 100644 --- a/artifactory/services/system.go +++ b/artifactory/services/system.go @@ -122,7 +122,7 @@ func (ss *SystemService) sendGet(endpoint string) ([]byte, error) { return nil, err } if err = errorutils.CheckResponseStatusWithBody(resp, body, http.StatusOK, http.StatusCreated); err != nil { - return nil, fmt.Errorf("failed while attempting to get Artifactory %s:\n%s", endpoint, err.Error()) + return nil, fmt.Errorf("got unexpected server response while attempting to get JFrog Artifactory %s:\n%s", endpoint, err.Error()) } log.Debug("Artifactory response:", resp.Status) return body, nil diff --git a/distribution/services/version.go b/distribution/services/version.go index c3cd4ac72..18e205c04 100644 --- a/distribution/services/version.go +++ b/distribution/services/version.go @@ -28,11 +28,11 @@ func (vs *VersionService) GetDistributionVersion() (string, error) { httpDetails := vs.DistDetails.CreateHttpClientDetails() resp, body, _, err := vs.client.SendGet(vs.DistDetails.GetUrl()+"api/v1/system/info", true, &httpDetails) if err != nil { - return "", errors.New("failed while attempting to get Distribution version: " + err.Error()) + return "", errors.New("failed while attempting to get JFrog Distribution version: " + err.Error()) } if err = errorutils.CheckResponseStatusWithBody(resp, body, http.StatusOK); err != nil { - return "", errors.New("failed while attempting to get JFrog Distribution version:\n" + err.Error()) + return "", errors.New("got unexpected server response while attempting to get JFrog Distribution version:\n" + err.Error()) } var version distributionVersion if err = json.Unmarshal(body, &version); err != nil { diff --git a/pipelines/services/system.go b/pipelines/services/system.go index 47578ca36..17ad24439 100644 --- a/pipelines/services/system.go +++ b/pipelines/services/system.go @@ -25,13 +25,13 @@ func (ss *SystemService) GetSystemInfo() (*PipelinesSystemInfo, error) { httpDetails := ss.ServiceDetails.CreateHttpClientDetails() resp, body, _, err := ss.client.SendGet(ss.ServiceDetails.GetUrl()+"api/v1/system/info", true, &httpDetails) if err != nil { - return nil, errors.New("failed while attempting to get Pipelines version: " + err.Error()) + return nil, errors.New("failed while attempting to get JFrog Pipelines version: " + err.Error()) } if err = errorutils.CheckResponseStatusWithBody(resp, body, http.StatusOK); err != nil { if resp.StatusCode == http.StatusNotFound { return nil, &PipelinesNotAvailableError{InnerError: err} } - return nil, errors.New("failed while attempting to get JFrog Pipelines version:\n" + err.Error()) + return nil, errors.New("got unexpected server response while attempting to get JFrog Pipelines version:\n" + err.Error()) } var sysInfo PipelinesSystemInfo if err = json.Unmarshal(body, &sysInfo); err != nil { diff --git a/xray/services/entitlements.go b/xray/services/entitlements.go index e0ddb9835..255397208 100644 --- a/xray/services/entitlements.go +++ b/xray/services/entitlements.go @@ -2,6 +2,7 @@ package services import ( "encoding/json" + "errors" "fmt" "net/http" @@ -30,10 +31,11 @@ func (es *EntitlementsService) IsEntitled(featureId string) (entitled bool, err httpDetails := es.XrayDetails.CreateHttpClientDetails() resp, body, _, err := es.client.SendGet(es.XrayDetails.GetUrl()+"api/v1/entitlements/feature/"+featureId, true, &httpDetails) if err != nil { + err = errors.New("failed while attempting to get JFrog Xray entitlements response: " + err.Error()) return } if err = errorutils.CheckResponseStatusWithBody(resp, body, http.StatusOK); err != nil { - return false, fmt.Errorf("failed while attempting to get JFrog Xray entitlements response for %s:\n%s", featureId, err.Error()) + return false, fmt.Errorf("got unexpected server response while attempting to get JFrog Xray entitlements response for %s:\n%s", featureId, err.Error()) } var userEntitlements entitlements if err = json.Unmarshal(body, &userEntitlements); err != nil { diff --git a/xray/services/version.go b/xray/services/version.go index f5a771ba7..a9bee460f 100644 --- a/xray/services/version.go +++ b/xray/services/version.go @@ -32,10 +32,10 @@ func (vs *VersionService) GetVersion() (string, error) { httpDetails := vs.XrayDetails.CreateHttpClientDetails() resp, body, _, err := vs.client.SendGet(vs.XrayDetails.GetUrl()+"api/v1/system/version", true, &httpDetails) if err != nil { - return "", errors.New("failed while attempting to get Xray version: " + err.Error()) + return "", errors.New("failed while attempting to get JFrog Xray version: " + err.Error()) } if err = errorutils.CheckResponseStatusWithBody(resp, body, http.StatusOK); err != nil { - return "", errors.New("failed while attempting to get JFrog Xray version:\n" + err.Error()) + return "", errors.New("got unexpected server response while attempting to get JFrog Xray version:\n" + err.Error()) } var version xrayVersion if err = json.Unmarshal(body, &version); err != nil {