From 531d1ef0894b5d247204c0d5d738d441853a1208 Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Tue, 9 Nov 2021 15:43:04 -0800 Subject: [PATCH] Fix godoc around errors returned from Inspector --- inspector.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/inspector.go b/inspector.go index e3a462b..870f36f 100644 --- a/inspector.go +++ b/inspector.go @@ -177,8 +177,8 @@ func (i *Inspector) DeleteQueue(qname string, force bool) error { // GetTaskInfo retrieves task information given a task id and queue name. // -// Returns ErrQueueNotFound if a queue with the given name doesn't exist. -// Returns ErrTaskNotFound if a task with the given id doesn't exist in the queue. +// Returns an error wrapping ErrQueueNotFound if a queue with the given name doesn't exist. +// Returns an error wrapping ErrTaskNotFound if a task with the given id doesn't exist in the queue. func (i *Inspector) GetTaskInfo(qname, id string) (*TaskInfo, error) { info, err := i.rdb.GetTaskInfo(qname, id) switch { @@ -479,8 +479,8 @@ func (i *Inspector) DeleteAllCompletedTasks(qname string) (int, error) { // The task needs to be in pending, scheduled, retry, or archived state, // otherwise DeleteTask will return an error. // -// If a queue with the given name doesn't exist, it returns ErrQueueNotFound. -// If a task with the given id doesn't exist in the queue, it returns ErrTaskNotFound. +// If a queue with the given name doesn't exist, it returns an error wrapping ErrQueueNotFound. +// If a task with the given id doesn't exist in the queue, it returns an error wrapping ErrTaskNotFound. // If the task is in active state, it returns a non-nil error. func (i *Inspector) DeleteTask(qname, id string) error { if err := base.ValidateQueueName(qname); err != nil { @@ -533,8 +533,8 @@ func (i *Inspector) RunAllArchivedTasks(qname string) (int, error) { // The task needs to be in scheduled, retry, or archived state, otherwise RunTask // will return an error. // -// If a queue with the given name doesn't exist, it returns ErrQueueNotFound. -// If a task with the given id doesn't exist in the queue, it returns ErrTaskNotFound. +// If a queue with the given name doesn't exist, it returns an error wrapping ErrQueueNotFound. +// If a task with the given id doesn't exist in the queue, it returns an error wrapping ErrTaskNotFound. // If the task is in pending or active state, it returns a non-nil error. func (i *Inspector) RunTask(qname, id string) error { if err := base.ValidateQueueName(qname); err != nil { @@ -586,8 +586,8 @@ func (i *Inspector) ArchiveAllRetryTasks(qname string) (int, error) { // The task needs to be in pending, scheduled, or retry state, otherwise ArchiveTask // will return an error. // -// If a queue with the given name doesn't exist, it returns ErrQueueNotFound. -// If a task with the given id doesn't exist in the queue, it returns ErrTaskNotFound. +// If a queue with the given name doesn't exist, it returns an error wrapping ErrQueueNotFound. +// If a task with the given id doesn't exist in the queue, it returns an error wrapping ErrTaskNotFound. // If the task is in already archived, it returns a non-nil error. func (i *Inspector) ArchiveTask(qname, id string) error { if err := base.ValidateQueueName(qname); err != nil {