diff --git a/internal/commands/scan.go b/internal/commands/scan.go index 1a796901..60fca692 100644 --- a/internal/commands/scan.go +++ b/internal/commands/scan.go @@ -2905,7 +2905,12 @@ func runCreateScanCommand( scanResponseModel = enrichScanResponseModel(cmd, scanResponseModel) err = printByScanInfoFormat(cmd, toScanView(scanResponseModel)) if err != nil { - return errors.Wrapf(err, "%s\n", failedCreating) + scanInfoFormat, _ := cmd.Flags().GetString(commonParams.ScanInfoFormatFlag) + return errors.Errorf( + "Scan %s was created successfully and is currently running. "+ + "However, scan info won't be returned because the specified format %q is not supported. "+ + "Supported formats: list, table, json.", + scanResponseModel.ID, scanInfoFormat) } } // Wait until the scan is done: Queued, Running