Add error errRangeDoesNotExist.
This commit is contained in:
parent
3fdc30a766
commit
b276a3c7ab
@ -69,7 +69,7 @@ func TestRemoveRange(t *testing.T) {
|
||||
name: "invalid block range range",
|
||||
start: 0,
|
||||
stop: 5,
|
||||
expected: errEmptyQueue,
|
||||
expected: errRangeDoesNotExist,
|
||||
},
|
||||
{
|
||||
name: "valid block range",
|
||||
|
@ -6,7 +6,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
errEmptyQueue = errors.New("queue is empty")
|
||||
errEmptyQueue = errors.New("queue is empty")
|
||||
errRangeDoesNotExist = errors.New("range does not exist in queue")
|
||||
)
|
||||
|
||||
type blockRangeQueue struct {
|
||||
@ -38,7 +39,7 @@ func (q *blockRangeQueue) search(rngReq RangeRequest) (int, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return 0, errEmptyQueue
|
||||
return 0, errRangeDoesNotExist
|
||||
}
|
||||
|
||||
func (q *blockRangeQueue) get() []RangeRequest {
|
||||
|
Loading…
Reference in New Issue
Block a user