diff options
author | Ritu Sood <ritu.sood@intel.com> | 2020-09-25 16:36:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-09-25 16:36:24 +0000 |
commit | 8b5c4236639a46f39cbfe852590f34e64f58a85a (patch) | |
tree | a2130c27227dbeffb903888b777ece8afd8f8302 /src/dcm/pkg/module/logicalcloud.go | |
parent | 6498e883dcbc005b32f86f8a57c96950c359d98e (diff) | |
parent | c585d2b091875dbc9575a960f4f42c1f14ec3366 (diff) |
Merge "Enhance error handling and HTTP codes in DCM"
Diffstat (limited to 'src/dcm/pkg/module/logicalcloud.go')
-rw-r--r-- | src/dcm/pkg/module/logicalcloud.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dcm/pkg/module/logicalcloud.go b/src/dcm/pkg/module/logicalcloud.go index 51ee387d..7d3c806b 100644 --- a/src/dcm/pkg/module/logicalcloud.go +++ b/src/dcm/pkg/module/logicalcloud.go @@ -145,7 +145,7 @@ func (v *LogicalCloudClient) Get(project, logicalCloudName string) (LogicalCloud } value, err := v.util.DBFind(v.storeName, key, v.tagMeta) if err != nil { - return LogicalCloud{}, pkgerrors.Wrap(err, "Get Logical Cloud") + return LogicalCloud{}, pkgerrors.Wrap(err, "Error getting Logical Cloud") } //value is a byte array @@ -153,12 +153,12 @@ func (v *LogicalCloudClient) Get(project, logicalCloudName string) (LogicalCloud lc := LogicalCloud{} err = v.util.DBUnmarshal(value[0], &lc) if err != nil { - return LogicalCloud{}, pkgerrors.Wrap(err, "Unmarshaling value") + return LogicalCloud{}, pkgerrors.Wrap(err, "Error unmarshaling value") } return lc, nil } - return LogicalCloud{}, pkgerrors.New("Error getting Logical Cloud") + return LogicalCloud{}, pkgerrors.New("Logical Cloud does not exist") } // GetAll returns Logical Clouds in the project @@ -213,12 +213,12 @@ func (v *LogicalCloudClient) Update(project, logicalCloudName string, c LogicalC } // Check for mismatch, logicalCloudName and payload logical cloud name if c.MetaData.LogicalCloudName != logicalCloudName { - return LogicalCloud{}, pkgerrors.New("Update Error - Logical Cloud name mismatch") + return LogicalCloud{}, pkgerrors.New("Logical Cloud name mismatch") } //Check if this Logical Cloud exists _, err := v.Get(project, logicalCloudName) if err != nil { - return LogicalCloud{}, pkgerrors.New("Update Error - Logical Cloud doesn't exist") + return LogicalCloud{}, pkgerrors.New("Logical Cloud does not exist") } err = v.util.DBInsert(v.storeName, key, nil, v.tagMeta, c) if err != nil { |