Skip to content

Commit c8bf4dd

Browse files
feat(detect): Handle new error codes introduced by blackduck (#5264)
Signed-off-by: Michael Kaplan <[email protected]> Co-authored-by: Christopher Fenner <[email protected]>
1 parent 7e31b4d commit c8bf4dd

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

cmd/detectExecuteScan.go

+19-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ func newDetectUtils(client *github.Client) detectUtils {
112112
"FAILURE_GENERAL_ERROR - Detect encountered a known error, details of the error are provided.",
113113
"FAILURE_UNKNOWN_ERROR - Detect encountered an unknown error.",
114114
"FAILURE_MINIMUM_INTERVAL_NOT_MET - Detect did not wait the minimum required scan interval.",
115+
"FAILURE_IAC - Detect was unable to perform IaC Scan against your source. Please check your configuration, and see logs and IaC Scanner documentation for more information.",
116+
"FAILURE_ACCURACY_NOT_MET - Detect was unable to meet the required accuracy.",
117+
"FAILURE_IMAGE_NOT_AVAILABLE - Image scan attempted but no return data available.",
118+
"FAILURE_COMPONENT_LOCATION_ANALYSIS => Component Location Analysis failed.",
115119
},
116120
},
117121
},
@@ -384,6 +388,16 @@ func mapErrorCategory(exitCodeKey int) {
384388
log.SetErrorCategory(log.ErrorService)
385389
case 12:
386390
log.SetErrorCategory(log.ErrorInfrastructure)
391+
case 13:
392+
log.SetErrorCategory(log.ErrorService)
393+
case 14:
394+
log.SetErrorCategory(log.ErrorService)
395+
case 15:
396+
log.SetErrorCategory(log.ErrorService)
397+
case 20:
398+
log.SetErrorCategory(log.ErrorService)
399+
case 25:
400+
log.SetErrorCategory(log.ErrorService)
387401
case 99:
388402
log.SetErrorCategory(log.ErrorService)
389403
case 100:
@@ -408,9 +422,13 @@ func exitCodeMapping(exitCodeKey int) string {
408422
10: "FAILURE_BLACKDUCK_VERSION_NOT_SUPPORTED => Detect attempted an operation that was not supported by your version of Black Duck. Ensure your Black Duck is compatible with this version of detect.",
409423
11: "FAILURE_BLACKDUCK_FEATURE_ERROR => Detect encountered an error while attempting an operation on Black Duck. Ensure your Black Duck is compatible with this version of detect.",
410424
12: "FAILURE_POLARIS_CONNECTIVITY => Detect was unable to connect to Polaris. Check your configuration and connection.",
425+
13: "FAILURE_MINIMUM_INTERVAL_NOT_MET => Detect did not wait the minimum required scan interval.",
426+
14: "FAILURE_IAC => Detect was unable to perform IaC Scan against your source. Please check your configuration, and see logs and IaC Scanner documentation for more information.",
427+
15: "FAILURE_ACCURACY_NOT_MET => Detect was unable to meet the required accuracy.",
428+
20: "FAILURE_IMAGE_NOT_AVAILABLE => Image scan attempted but no return data available.",
429+
25: "FAILURE_COMPONENT_LOCATION_ANALYSIS => Component Location Analysis failed. ",
411430
99: "FAILURE_GENERAL_ERROR => Detect encountered a known error, details of the error are provided.",
412431
100: "FAILURE_UNKNOWN_ERROR => Detect encountered an unknown error.",
413-
13: "FAILURE_MINIMUM_INTERVAL_NOT_MET => Detect did not wait the minimum required scan interval.",
414432
}
415433

416434
if _, isKeyExists := exitCodes[exitCodeKey]; isKeyExists {

0 commit comments

Comments
 (0)