Skip to content

Commit ce5cc8d

Browse files
author
Anivar A Aravind
committed
topdown: Include both input and error details in PURL parse errors
As suggested by @srenatus, error messages now include both the invalid input string and the underlying parser error using %w for proper error wrapping. This provides better debugging information when parsing fails.
1 parent f38a814 commit ce5cc8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

v1/topdown/purl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func builtinPurlParse(_ BuiltinContext, operands []*ast.Term, iter func(*ast.Ter
3131

3232
purl, err := packageurl.FromString(string(str))
3333
if err != nil {
34-
return fmt.Errorf("invalid PURL: %s", str)
34+
return fmt.Errorf("invalid PURL: %s: %w", str, err)
3535
}
3636

3737
// Handle qualifiers - always return an object (empty if no qualifiers)

0 commit comments

Comments
 (0)