github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/storage/errors.go (about) 1 package storage 2 3 import ( 4 "errors" 5 ) 6 7 var ( 8 // ErrNotFound is returned when a retrieved key does not exist in the database. 9 // Note: there is another not found error: badger.ErrKeyNotFound. The difference between 10 // badger.ErrKeyNotFound and storage.ErrNotFound is that: 11 // badger.ErrKeyNotFound is the error returned by the badger API. 12 // Modules in storage/badger and storage/badger/operation package both 13 // return storage.ErrNotFound for not found error 14 ErrNotFound = errors.New("key not found") 15 16 // ErrAlreadyExists is returned when an insert attempts to set the value 17 // for a key that already exists. Inserts may only occur once per key, 18 // updates may overwrite an existing key without returning an error. 19 ErrAlreadyExists = errors.New("key already exists") 20 21 // ErrDataMismatch is returned when a repeatable insert operation attempts 22 // to insert a different value for the same key. 23 ErrDataMismatch = errors.New("data for key is different") 24 25 // ErrHeightNotIndexed is returned when data that is indexed sequentially is queried by a given block height 26 // and that data is unavailable. 27 ErrHeightNotIndexed = errors.New("data for block height not available") 28 29 // ErrNotBootstrapped is returned when the database has not been bootstrapped. 30 ErrNotBootstrapped = errors.New("pebble database not bootstrapped") 31 )