소스 검색

- Builder: return an error when the build fails

Solomon Hykes 12 년 전
부모
커밋
d9bce2defd
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      api.go

+ 5 - 2
api.go

@@ -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