diff options
author | Igor D.C <igor.duarte.cardoso@intel.com> | 2020-09-25 00:04:58 +0000 |
---|---|---|
committer | Igor D.C <igor.duarte.cardoso@intel.com> | 2020-09-25 05:28:52 +0000 |
commit | c585d2b091875dbc9575a960f4f42c1f14ec3366 (patch) | |
tree | aba0039b6477dfbc2790cd5efc365a6d9ccb4390 /src/dcm/pkg/module/userpermissions.go | |
parent | ab8142dfc0f54bfc140e240fe558ac5be8d60ea5 (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/userpermissions.go')
-rw-r--r-- | src/dcm/pkg/module/userpermissions.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dcm/pkg/module/userpermissions.go b/src/dcm/pkg/module/userpermissions.go index 2cff712b..4c918f0f 100644 --- a/src/dcm/pkg/module/userpermissions.go +++ b/src/dcm/pkg/module/userpermissions.go @@ -124,7 +124,7 @@ func (v *UserPermissionClient) GetUserPerm(project, logicalCloud, userPermName s return up, nil } - return UserPermission{}, pkgerrors.New("Error getting User Permission") + return UserPermission{}, pkgerrors.New("User Permission does not exist") } // GetAll lists all user permissions @@ -184,7 +184,7 @@ func (v *UserPermissionClient) UpdateUserPerm(project, logicalCloud, userPermNam _, err := v.GetUserPerm(project, logicalCloud, userPermName) if err != nil { return UserPermission{}, pkgerrors.New( - "Update Error - User Permission doesn't exist") + "User Permission does not exist") } err = v.util.DBInsert(v.storeName, key, nil, v.tagMeta, c) if err != nil { |