- Builder: return an error when the build fails

This commit is contained in:
Solomon Hykes 2013-06-20 22:15:19 -07:00
parent 352991bdf4
commit d9bce2defd
1 changed files with 5 additions and 2 deletions

7
api.go
View File

@ -773,9 +773,12 @@ func postBuild(srv *Server, version float64, w http.ResponseWriter, r *http.Requ
context = c
}
b := NewBuildFile(srv, utils.NewWriteFlusher(w))
if id, err := b.Build(context); err != nil {
id, err := b.Build(context)
if err != nil {
fmt.Fprintf(w, "Error build: %s\n", err)
} else if repoName != "" {
return err
}
if repoName != "" {
srv.runtime.repositories.Set(repoName, tag, id, false)
}
return nil