Update RDB.EnqueueUnique and RDB.ScheduleUnique with specific errors

This commit is contained in:
Ken Hibino
2021-05-09 07:39:01 -07:00
parent ffe9aa74b3
commit d98ecdebb4
3 changed files with 28 additions and 29 deletions

View File

@@ -147,9 +147,17 @@ func CanonicalCode(err error) Code {
}
/******************************************
Domin Specific Error Types
Domin Specific Error Types & Values
*******************************************/
var (
// ErrNoProcessableTask indicates that there are no tasks ready to be processed.
ErrNoProcessableTask = errors.New("no tasks are ready for processing")
// ErrDuplicateTask indicates that another task with the same unique key holds the uniqueness lock.
ErrDuplicateTask = errors.New("task already exists")
)
// TaskNotFoundError indicates that a task with the given ID does not exist
// in the given queue.
type TaskNotFoundError struct {