fix: add panic recovery for license parse (#1839)

* fix: add panic recovery for license parse
---------
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
Christopher Angelo Phillips
2023-05-23 16:58:49 +00:00
committed by GitHub
parent 087a6356b9
commit 4ac8fdf6df
2 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ func (l Licenses) Swap(i, j int) {
func NewLicense(value string) License {
spdxExpression, err := license.ParseExpression(value)
if err != nil {
log.Trace("unable to parse license expression: %w", err)
log.Trace("unable to parse license expression for %q: %w", value, err)
}
return License{