-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
33 lines (25 loc) · 1.38 KB
/
errors.go
File metadata and controls
33 lines (25 loc) · 1.38 KB
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
32
33
package heapcraft
import "errors"
var (
// ErrCallbackNotFound is returned when attempting to deregister a callback that
// doesn't exist.
ErrCallbackNotFound = errors.New("callback not found")
// ErrHeapEmpty is returned when attempting to access elements from an empty heap.
ErrHeapEmpty = errors.New("the heap is empty and contains no elements")
// ErrIndexOutOfBounds is returned when attempting to access an index that is outside
// the valid range of the heap.
ErrIndexOutOfBounds = errors.New("index out of bounds")
// ErrPriorityLessThanLast is returned when attempting to insert a priority that is
// less than the last extracted priority, which would violate the monotonic property
// of the radix heap.
ErrPriorityLessThanLast = errors.New("insertion of a priority less than last popped")
// ErrNoRebalancingNeeded is returned when attempting to rebalance a radix heap
// that doesn't need rebalancing (bucket 0 already contains elements).
ErrNoRebalancingNeeded = errors.New("no rebalancing needed")
// ErrNodeNotFound is returned when attempting to access a node with an ID that
// does not exist in the pairing heap.
ErrNodeNotFound = errors.New("id does not link to existing node")
// ErrIDGenerationFailed is returned when attempting to generate a unique ID for a
// node that already exists.
ErrIDGenerationFailed = errors.New("failed to generate a unique ID")
)