Skip to content

Commit

Permalink
Improve AMS error experience (#1247)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephan Hesselmann <[email protected]>
  • Loading branch information
ivan-degtiarenko and stehessel authored Oct 26, 2023
1 parent 5fa0eaa commit 9eab20a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,9 @@ func OrganisationNameInvalid(externalID string, name string) *ServiceError {
// FailedClusterAuthorization converts the error to a ServiceError and returns a reason and hint for the user.
func FailedClusterAuthorization(err error) *ServiceError {
svcErr := ToServiceError(err)
reason := "failed to reserve quota"
// Visiting the OpenShift page in console registers the user and their organisation with OCM.
// See https://issues.redhat.com/browse/SDB-3194 for more context.
if svcErr.Is404() {
reason += " - visit https://console.redhat.com/openshift and try again"
reason := "failed to use ACSCS subscription"
if svcErr.IsForbidden() {
reason += " - please contact your administrator to ensure that your Red Hat account has the RedhatManagedCluster permission."
}
return NewWithCause(svcErr.Code, svcErr, reason)
}

0 comments on commit 9eab20a

Please sign in to comment.