forked from beeker1121/goque
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
31 lines (24 loc) · 999 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
25
26
27
28
29
30
31
package goque
import (
"errors"
ldberrors "github.com/syndtr/goleveldb/leveldb/errors"
)
var (
// ErrIncompatibleType is returned when the opener type is
// incompatible with the stored Goque type.
ErrIncompatibleType = errors.New("goque: Opener type is incompatible with stored Goque type")
// ErrEmpty is returned when the stack or queue is empty.
ErrEmpty = errors.New("goque: Stack or queue is empty")
// ErrOutOfBounds is returned when the ID used to lookup an item
// is outside of the range of the stack or queue.
ErrOutOfBounds = errors.New("goque: ID used is outside range of stack or queue")
// ErrDBClosed is returned when the Close function has already
// been called, causing the stack or queue to close, as well as
// its underlying database.
ErrDBClosed = errors.New("goque: Database is closed")
)
// IsCorrupted returns a boolean indicating whether the error is indicating
// a corruption.
func IsCorrupted(err error) bool {
return ldberrors.IsCorrupted(err)
}