Skip to content

Commit

Permalink
empty list handling improved #3459
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-dmlr committed Sep 27, 2024
1 parent 96acbf5 commit 6b95e10
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sechub-cli/src/mercedes-benz.com/sechub/cli/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func printSecHubJobSummaryAndFailOnTrafficLight(context *Context) {
func getSecHubJobList(context *Context, size int) {
// Print filtering labels if defined
for key, value := range context.config.labels {
sechubUtil.LogNotice("Label match "+key+"="+value)
sechubUtil.LogNotice("Filtered by label "+key+"="+value)
}

// Request SecHub job list from server
Expand Down Expand Up @@ -202,7 +202,9 @@ func getLatestSecHubJobUUID(context *Context, expectedState ...string) string {
getSecHubJobList(context, 5)

if len(context.jobList.List) == 0 {
sechubUtil.LogError("No SecHub jobs found. Have you started a scan?")
sechubUtil.LogWarning("No SecHub jobs found for "+context.config.projectID+". Have you started a scan?")
// Return 0 because we do not regard this as an error
os.Exit(ExitCodeOK)
}

// If not provided: accept any job state
Expand Down

0 comments on commit 6b95e10

Please sign in to comment.