From b4862f77347856943049466f1bc4c8878c96c928 Mon Sep 17 00:00:00 2001 From: jay-nanduri <72423211+jay-nanduri@users.noreply.github.com> Date: Mon, 12 Jul 2021 18:10:23 -0400 Subject: [PATCH] Added step to check the scan status and exit (#219) --- internal/commands/scan.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/commands/scan.go b/internal/commands/scan.go index ebc5ef79f..9e980b0e3 100644 --- a/internal/commands/scan.go +++ b/internal/commands/scan.go @@ -503,7 +503,12 @@ func isScanRunning(scansWrapper wrappers.ScansWrapper, scanID string) bool { return true } } + if scanResponseModel.Status != "Completed" { + fmt.Println("Scan Finished with status: ", scanResponseModel.Status) + os.Exit(1) + } fmt.Println("Scan finished, final status: ", scanResponseModel.Status) + return false }