зеркало из https://github.com/Azure/ARO-RP.git
Merge pull request #2744 from carvalhe/SubnetCannotBeDeleted_to_UserError
Add new clouderror for inUseSubnet
This commit is contained in:
Коммит
cb2b5ccd35
|
@ -99,6 +99,7 @@ const (
|
|||
CloudErrorCodeQuotaExceeded = "QuotaExceeded"
|
||||
CloudErrorCodeResourceProviderNotRegistered = "ResourceProviderNotRegistered"
|
||||
CloudErrorCodeCannotDeleteLoadBalancerByID = "CannotDeleteLoadBalancerWithPrivateLinkService"
|
||||
CloudErrorCodeInUseSubnetCannotBeDeleted = "InUseSubnetCannotBeDeleted"
|
||||
)
|
||||
|
||||
// NewCloudError returns a new CloudError
|
||||
|
|
|
@ -264,6 +264,10 @@ func deleteByIdCloudError(err error) error {
|
|||
case strings.Contains(detailedError.Original.Error(), "AuthorizationFailed"):
|
||||
return api.NewCloudError(http.StatusForbidden, api.CloudErrorCodeForbidden,
|
||||
"features.ResourcesClient#DeleteByID", detailedError.Original.Error())
|
||||
|
||||
case strings.Contains(detailedError.Original.Error(), "InUseSubnetCannotBeDeleted"):
|
||||
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInUseSubnetCannotBeDeleted,
|
||||
"features.ResourcesClient#DeleteByID", detailedError.Original.Error())
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче