-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patherrors.go
More file actions
26 lines (23 loc) · 837 Bytes
/
errors.go
File metadata and controls
26 lines (23 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package keydb
import "errors"
var KeyNotFound = errors.New("key not found")
var KeyTooLong = errors.New("key too long, max 1024")
var EmptyKey = errors.New("key is empty")
var TransactionClosed = errors.New("transaction closed")
var DatabaseClosed = errors.New("database closed")
var DatabaseInUse = errors.New("database in use")
var DatabaseHasOpenTransactions = errors.New("database has open transactions")
var NoDatabaseFound = errors.New("no database found")
var NotADirectory = errors.New("path is not a directory")
var NotValidDatabase = errors.New("path is not a valid database")
var EndOfIterator = errors.New("end of iterator")
var ReadOnlySegment = errors.New("read only segment")
// returns the first non-nil error
func errn(errs ...error) error {
for _, v := range errs {
if v != nil {
return v
}
}
return nil
}