-
Notifications
You must be signed in to change notification settings - Fork 177
/
errors.go
24 lines (20 loc) · 966 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package storage
import (
"errors"
)
var (
// ErrNotFound is returned when a retrieved key does not exist in the database.
// Note: there is another not found error: badger.ErrKeyNotFound. The difference between
// badger.ErrKeyNotFound and storage.ErrNotFound is that:
// badger.ErrKeyNotFound is the error returned by the badger API.
// Modules in storage/badger and storage/badger/operation package both
// return storage.ErrNotFound for not found error
ErrNotFound = errors.New("key not found")
// ErrAlreadyExists is returned when an insert attempts to set the value
// for a key that already exists. Inserts may only occur once per key,
// updates may overwrite an existing key without returning an error.
ErrAlreadyExists = errors.New("key already exists")
// ErrDataMismatch is returned when a repeatable insert operation attempts
// to insert a different value for the same key.
ErrDataMismatch = errors.New("data for key is different")
)