fix build issue and check err

This commit is contained in:
zzxwill
2020-08-19 18:23:53 +08:00
parent 657cb91db3
commit 59a7a96cae
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ var _ = ginkgo.Describe("API Workload", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
var r apis.Response
err = json.Unmarshal(result, &r)
gomega.Expect(http.StatusOK).Should(gomega.Equal(r.Code))
gomega.Expect(http.StatusInternalServerError).Should(gomega.Equal(r.Code))
output := fmt.Sprintf("required flag(s) \"image\" not set")
gomega.Expect(r.Data.(string)).To(gomega.ContainSubstring(output))
})
+4
View File
@@ -28,6 +28,10 @@ func CreateWorkload(c *gin.Context) {
var template types.Capability
template, err := plugins.LoadCapabilityByName(body.WorkloadType)
if err != nil {
util.HandleError(c, util.StatusInternalServerError, err.Error())
return
}
appObj, err := oam.BaseComplete(evnName, body.WorkloadName, body.AppGroup, fs, template)
if err != nil {
util.HandleError(c, util.StatusInternalServerError, err.Error())