Skip to content

Commit

Permalink
update err name and message
Browse files Browse the repository at this point in the history
Signed-off-by: Meredith Lancaster <[email protected]>
  • Loading branch information
malancas committed Aug 30, 2024
1 parent 47e937f commit 1f5bb05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/attestation/verification/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

var ErrUnrecognisedBundleExtension = errors.New("bundle file extension not supported, must be json or jsonl")
var ErrEmptyJSONLFile = errors.New("provided jsonl file is empty")
var ErrEmptyBundleFile = errors.New("provided bundle file is empty")

type FetchAttestationsConfig struct {
APIClient api.Client
Expand Down Expand Up @@ -107,7 +107,7 @@ func loadBundlesFromJSONLinesFile(path string) ([]*api.Attestation, error) {
}

if len(attestations) == 0 {
return nil, ErrEmptyJSONLFile
return nil, ErrEmptyBundleFile
}

return attestations, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/attestation/verification/attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestLoadBundlesFromJSONLinesFile_RejectEmptyJSONLFile(t *testing.T) {

attestations, err := loadBundlesFromJSONLinesFile(emptyJSONL.Name())

require.ErrorIs(t, err, ErrEmptyJSONLFile)
require.ErrorIs(t, err, ErrEmptyBundleFile)
require.Nil(t, attestations)
}

Expand Down

0 comments on commit 1f5bb05

Please sign in to comment.