Skip to content

Commit

Permalink
improve error message in case the LicensePath is UNKNOWN
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
  • Loading branch information
inteon committed Aug 25, 2023
1 parent e3146eb commit e3831ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion report.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ func reportMain(_ *cobra.Command, args []string) error {
reportDataFlat := make([]libraryDataFlat, 0, len(reportData))
for _, lib := range reportData {
if len(lib.LicenseNames) == 0 {
klog.Errorf("Error identifying license in %q: %v", lib.LicensePath, fmt.Errorf("no license found"))
if lib.LicensePath != UNKNOWN {
klog.Errorf("Error identifying license in %q: %v", lib.LicensePath, fmt.Errorf("no license found"))
} else {
klog.Errorf("Error identifying license for %q: %v", lib.Name, fmt.Errorf("no license found"))
}
reportDataFlat = append(reportDataFlat, libraryDataFlat{
Name: lib.Name,
Version: lib.Version,
Expand Down

0 comments on commit e3831ab

Please sign in to comment.