Skip to content

Commit ec03767

Browse files
Log audit errors when partial results are allowed (v2 backport). (#1354)
When allow_partial_results is enabled, frogbot continued without failing but only logged a generic warning, hiding the underlying audit error. Include the actual error in the warning so pipelines remain debuggable. Backport of #1352 for master. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a4e08bc commit ec03767

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

scanrepository/scanrepository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func (cfp *ScanRepositoryCmd) fixVulnerablePackages(repository *utils.Repository
291291
err = cfp.fixIssuesSeparatePRs(repository, vulnerabilitiesByWdMap)
292292
}
293293
if err != nil {
294-
return utils.CreateErrorIfPartialResultsDisabled(cfp.scanDetails.AllowPartialResults(), fmt.Sprintf("failed to fix vulnerable dependencies: %s", err.Error()), err)
294+
return utils.CreateErrorIfPartialResultsDisabled(cfp.scanDetails.AllowPartialResults(), "failed to fix vulnerable dependencies", err)
295295
}
296296
return
297297
}

utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ func isUrlAccessible(url string) bool {
585585
// This function checks if partial results are allowed by the user. If so instead of returning an error we log the error and continue as if we didn't have an error
586586
func CreateErrorIfPartialResultsDisabled(allowPartial bool, messageForLog string, err error) error {
587587
if allowPartial {
588-
log.Warn(messageForLog)
588+
log.Warn(fmt.Sprintf("%s: %v", messageForLog, err))
589589
return nil
590590
}
591591
return err

0 commit comments

Comments
 (0)