Skip to content

Commit a86b5c4

Browse files
authored
chore(preflight): Better error message when not results found (#1397)
code(preflight): Better error message when not results found
1 parent bd275df commit a86b5c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/preflight/run.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ func RunPreflights(interactive bool, output string, format string, args []string
114114
preflightSpecName = spec.Name
115115
}
116116

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

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

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

148148
if interactive {

0 commit comments

Comments
 (0)