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/keyvalue.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/keyvalue.go')
-rw-r--r-- | src/dcm/pkg/module/keyvalue.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dcm/pkg/module/keyvalue.go b/src/dcm/pkg/module/keyvalue.go index 37c74a84..0127a6f4 100644 --- a/src/dcm/pkg/module/keyvalue.go +++ b/src/dcm/pkg/module/keyvalue.go @@ -133,7 +133,7 @@ func (v *KeyValueClient) GetKVPair(project, logicalCloud, kvPairName string) (Ke return kv, nil } - return KeyValue{}, pkgerrors.New("Error getting Key Value") + return KeyValue{}, pkgerrors.New("Key Value does not exist") } // Get All lists all key value pairs @@ -194,7 +194,7 @@ func (v *KeyValueClient) UpdateKVPair(project, logicalCloud, kvPairName string, //Check if this Key Value exists _, err := v.GetKVPair(project, logicalCloud, kvPairName) if err != nil { - return KeyValue{}, pkgerrors.New("Update Error - Key Value Pair doesn't exist") + return KeyValue{}, pkgerrors.New("KV Pair does not exist") } err = v.util.DBInsert(v.storeName, key, nil, v.tagMeta, c) if err != nil { |