Skip to content

Commit

Permalink
code(preflight): Better error message when not results found
Browse files Browse the repository at this point in the history
  • Loading branch information
banjoh committed Dec 1, 2023
1 parent fef12be commit b5e3fea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/preflight/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func RunPreflights(interactive bool, output string, format string, args []string
preflightSpecName = spec.Name
}

if collectResults == nil && uploadCollectResults == nil {
return types.NewExitCodeError(constants.EXIT_CODE_CATCH_ALL, errors.New("no results"))
if len(collectResults) == 0 && len(uploadCollectResults) == 0 {
return types.NewExitCodeError(constants.EXIT_CODE_CATCH_ALL, errors.New("no data was collected"))
}

analyzeResults := []*analyzer.AnalyzeResult{}
Expand All @@ -142,7 +142,7 @@ func RunPreflights(interactive bool, output string, format string, args []string
progressCollection.Wait()

if len(analyzeResults) == 0 {
return types.NewExitCodeError(constants.EXIT_CODE_CATCH_ALL, errors.New("no data has been collected"))
return types.NewExitCodeError(constants.EXIT_CODE_CATCH_ALL, errors.New("completed with no analysis results"))
}

if interactive {
Expand Down

0 comments on commit b5e3fea

Please sign in to comment.