diff --git a/api/build/compile_publish.go b/api/build/compile_publish.go index 69d6098e0..a9d52645f 100644 --- a/api/build/compile_publish.go +++ b/api/build/compile_publish.go @@ -426,6 +426,8 @@ func CompileAndPublish( // error out the build CleanBuild(c, database, b, nil, nil, retErr) + util.HandleError(c, http.StatusBadRequest, retErr) + return nil, nil, retErr } diff --git a/api/webhook/post.go b/api/webhook/post.go index 82db4a899..f964398d7 100644 --- a/api/webhook/post.go +++ b/api/webhook/post.go @@ -309,6 +309,11 @@ func PostWebhook(c *gin.Context) { queue.FromContext(c), ) + // error handling done in CompileAndPublish + if err != nil { + return + } + // capture the build and repo from the items b, repo = item.Build, item.Repo