aboutsummaryrefslogtreecommitdiffstats
path: root/src/dcm/pkg/module/quota.go
diff options
context:
space:
mode:
authorIgor D.C <igor.duarte.cardoso@intel.com>2020-09-25 00:04:58 +0000
committerIgor D.C <igor.duarte.cardoso@intel.com>2020-09-25 05:28:52 +0000
commitc585d2b091875dbc9575a960f4f42c1f14ec3366 (patch)
treeaba0039b6477dfbc2790cd5efc365a6d9ccb4390 /src/dcm/pkg/module/quota.go
parentab8142dfc0f54bfc140e240fe558ac5be8d60ea5 (diff)
Enhance error handling and HTTP codes in DCM
This improves error handling between DCM and the database resources and adds/corrects a lot more HTTP return codes in the API, respectively. Issue-ID: MULTICLOUD-1143 Change-Id: I3abc8025660e042f4c946f8bbfd280e1eb4c9583 Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
Diffstat (limited to 'src/dcm/pkg/module/quota.go')
-rw-r--r--src/dcm/pkg/module/quota.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dcm/pkg/module/quota.go b/src/dcm/pkg/module/quota.go
index cbd9c8b7..8e15a794 100644
--- a/src/dcm/pkg/module/quota.go
+++ b/src/dcm/pkg/module/quota.go
@@ -152,7 +152,7 @@ func (v *QuotaClient) GetQuota(project, logicalCloud, quotaName string) (Quota,
return q, nil
}
- return Quota{}, pkgerrors.New("Error getting Quota")
+ return Quota{}, pkgerrors.New("Cluster Quota does not exist")
}
// GetAll returns all cluster quotas in the logical cloud
@@ -211,7 +211,7 @@ func (v *QuotaClient) UpdateQuota(project, logicalCloud, quotaName string, c Quo
//Check if this Quota exists
_, err := v.GetQuota(project, logicalCloud, quotaName)
if err != nil {
- return Quota{}, pkgerrors.New("Update Error - Quota doesn't exist")
+ return Quota{}, pkgerrors.New("Cluster Quota does not exist")
}
err = v.util.DBInsert(v.storeName, key, nil, v.tagMeta, c)
if err != nil {