mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 17:03:17 +01:00
bump error language and remove panic (#862)
* bump error language and remove panic Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
parent
4a8a9ce290
commit
ad322b3314
@ -125,7 +125,7 @@ func attestExec(ctx context.Context, _ *cobra.Command, args []string) error {
|
|||||||
userInput := args[0]
|
userInput := args[0]
|
||||||
si, err := source.ParseInput(userInput, false)
|
si, err := source.ParseInput(userInput, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not generate source input for attest command: %q", err)
|
return fmt.Errorf("could not generate source input for attest command: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch si.Scheme {
|
switch si.Scheme {
|
||||||
|
|||||||
@ -231,7 +231,7 @@ func packagesExec(_ *cobra.Command, args []string) error {
|
|||||||
userInput := args[0]
|
userInput := args[0]
|
||||||
si, err := source.ParseInput(userInput, true)
|
si, err := source.ParseInput(userInput, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not generate source input for attest command: %q", err)
|
return fmt.Errorf("could not generate source input for packages command: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return eventLoop(
|
return eventLoop(
|
||||||
@ -306,7 +306,7 @@ func packagesExecWorker(si source.Input, writer sbom.Writer) <-chan error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if s == nil {
|
if s == nil {
|
||||||
panic("nil sbomb returned with no error")
|
errs <- fmt.Errorf("no SBOM produced for %q", si.UserInput)
|
||||||
}
|
}
|
||||||
|
|
||||||
if appConfig.Anchore.Host != "" {
|
if appConfig.Anchore.Host != "" {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user