summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2020-10-16 23:22:22 +0000
committerGerrit Code Review <gerrit@onap.org>2020-10-16 23:22:22 +0000
commit2573d840571cb511e27ba5ef663a4b99bc717a45 (patch)
tree2d31e9e307082f0c419a433837a64dc4afc9b633
parentedaf4416c5002254b60199a0b9710ebb23ccdf7b (diff)
parent0c527d07b604fc9ecad713732c3d9bb5d5ace31e (diff)
Merge "delete should return 404 error for invalid name"
-rw-r--r--src/orchestrator/api/composite_app_handler.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/orchestrator/api/composite_app_handler.go b/src/orchestrator/api/composite_app_handler.go
index d531b28d..761d60b9 100644
--- a/src/orchestrator/api/composite_app_handler.go
+++ b/src/orchestrator/api/composite_app_handler.go
@@ -130,7 +130,12 @@ func (h compositeAppHandler) deleteHandler(w http.ResponseWriter, r *http.Reques
version := vars["version"]
projectName := vars["project-name"]
- err := h.client.DeleteCompositeApp(name, version, projectName)
+ _, err := h.client.GetCompositeApp(name, version, projectName)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusNotFound)
+ return
+ }
+ err = h.client.DeleteCompositeApp(name, version, projectName)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return