Skip to content
Snippets Groups Projects
Commit 1d7b9b97 authored by rahix's avatar rahix
Browse files

Show first error instead of last when no working version is published yet

parent b1ee054a
No related branches found
No related tags found
No related merge requests found
...@@ -343,6 +343,7 @@ func (s *server) getAppInfo(ctx context.Context, pathInRepo, repo string) (*appI ...@@ -343,6 +343,7 @@ func (s *server) getAppInfo(ctx context.Context, pathInRepo, repo string) (*appI
highestVer := 0 highestVer := 0
highsetVerNil := true highsetVerNil := true
firstTime := make(map[int]*appInfo) firstTime := make(map[int]*appInfo)
var firstErr error = nil
for { for {
info, err := s.parseAppToml(ctx, pathInRepo, obj) info, err := s.parseAppToml(ctx, pathInRepo, obj)
if err == nil { if err == nil {
...@@ -354,6 +355,9 @@ func (s *server) getAppInfo(ctx context.Context, pathInRepo, repo string) (*appI ...@@ -354,6 +355,9 @@ func (s *server) getAppInfo(ctx context.Context, pathInRepo, repo string) (*appI
} }
} else { } else {
log.Printf("%s@%s: %v", repo, obj.Hash.String(), err) log.Printf("%s@%s: %v", repo, obj.Hash.String(), err)
if firstErr == nil {
firstErr = err
}
} }
if len(obj.ParentHashes) == 0 { if len(obj.ParentHashes) == 0 {
break break
...@@ -365,6 +369,9 @@ func (s *server) getAppInfo(ctx context.Context, pathInRepo, repo string) (*appI ...@@ -365,6 +369,9 @@ func (s *server) getAppInfo(ctx context.Context, pathInRepo, repo string) (*appI
} }
if highsetVerNil { if highsetVerNil {
if firstErr != nil {
return nil, firstErr
}
return nil, fmt.Errorf("no `version` field in `flow3r.toml`") return nil, fmt.Errorf("no `version` field in `flow3r.toml`")
} }
stars, err := s.getStars(ctx, repo) stars, err := s.getStars(ctx, repo)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment