diff --git a/scanrepository/scanrepository.go b/scanrepository/scanrepository.go index 2f2daee07..be9888893 100644 --- a/scanrepository/scanrepository.go +++ b/scanrepository/scanrepository.go @@ -248,7 +248,7 @@ func (sr *ScanRepositoryCmd) fixVulnerablePackages(repository *utils.Repository, } } if err != nil { - return utils.CreateErrorIfFailUponScannerErrorEnabled(repository.GeneralConfig.FailUponAnyScannerError, fmt.Sprintf("failed to fix vulnerable dependencies: %s", err.Error()), err) + return utils.CreateErrorIfFailUponScannerErrorEnabled(repository.GeneralConfig.FailUponAnyScannerError, "failed to fix vulnerable dependencies", err) } return nil } diff --git a/utils/utils.go b/utils/utils.go index ec88f6262..10414147d 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -466,7 +466,7 @@ func isUrlAccessible(url string) bool { // If not - instead of returning an error we log the error and continue as if we didn't have an error func CreateErrorIfFailUponScannerErrorEnabled(fail bool, messageForLog string, err error) error { if !fail { - log.Warn(messageForLog) + log.Warn(fmt.Sprintf("%s: %v", messageForLog, err)) return nil } return err