func BuildList(rw http.ResponseWriter, r *http.Request) error { app := mux.Vars(r)["app"] builds, err := models.ListBuilds(app) if err != nil { return err } _, err = models.GetApp(app) if awsError(err) == "ValidationError" { return RenderNotFound(rw, fmt.Sprintf("no such app: %s", app)) } if err != nil { return err } return RenderJson(rw, builds) }
func BuildList(rw http.ResponseWriter, r *http.Request) *httperr.Error { app := mux.Vars(r)["app"] builds, err := models.ListBuilds(app) if err != nil { return httperr.Server(err) } _, err = models.GetApp(app) if awsError(err) == "ValidationError" { return httperr.Errorf(404, "no such app: %s", app) } if err != nil { return httperr.Server(err) } return RenderJson(rw, builds) }