diff --git a/store/store.go b/store/store.go index 8a9c257..a4f54dc 100644 --- a/store/store.go +++ b/store/store.go @@ -20,6 +20,7 @@ import ( "crypto/sha512" "database/sql" "encoding/json" + "errors" "fmt" "hash" "io" @@ -59,6 +60,10 @@ var diskvStores = [...]string{ "imageManifest", } +var ( + ErrKeyNotFound = errors.New("no keys found") +) + // Store encapsulates a content-addressable-storage for storing ACIs on disk. type Store struct { base string @@ -220,7 +225,7 @@ func (s Store) ResolveKey(key string) (string, error) { keyCount := len(aciInfos) if keyCount == 0 { - return "", fmt.Errorf("no keys found") + return "", ErrKeyNotFound } if keyCount != 1 { return "", fmt.Errorf("ambiguous key: %q", key)