Add error errRangeDoesNotExist.

This commit is contained in:
Arijit Das 2021-11-02 07:33:20 +05:30
parent 3fdc30a766
commit b276a3c7ab
2 changed files with 4 additions and 3 deletions

View File

@ -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",

View File

@ -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 {