From 1f5bb052d7d6f1c28c78cd2b469074d50086d3a7 Mon Sep 17 00:00:00 2001 From: Meredith Lancaster Date: Fri, 30 Aug 2024 08:10:43 -0600 Subject: [PATCH] update err name and message Signed-off-by: Meredith Lancaster --- pkg/cmd/attestation/verification/attestation.go | 4 ++-- pkg/cmd/attestation/verification/attestation_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/attestation/verification/attestation.go b/pkg/cmd/attestation/verification/attestation.go index 3004af0a7ec..60c0ca50b4e 100644 --- a/pkg/cmd/attestation/verification/attestation.go +++ b/pkg/cmd/attestation/verification/attestation.go @@ -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 @@ -107,7 +107,7 @@ func loadBundlesFromJSONLinesFile(path string) ([]*api.Attestation, error) { } if len(attestations) == 0 { - return nil, ErrEmptyJSONLFile + return nil, ErrEmptyBundleFile } return attestations, nil diff --git a/pkg/cmd/attestation/verification/attestation_test.go b/pkg/cmd/attestation/verification/attestation_test.go index 047bbe4c268..d91f2741c0f 100644 --- a/pkg/cmd/attestation/verification/attestation_test.go +++ b/pkg/cmd/attestation/verification/attestation_test.go @@ -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) }