@@ -137,7 +137,7 @@ func (q *taskQueue[T]) Extend(ctx context.Context, taskID string) error {
137137 MinIdle : 0 , // Always claim this message
138138 }).Result ()
139139 if err != nil && err != redis .Nil {
140- return errors .Wrap (nil , "could not extend lease" )
140+ return errors .Wrap (err , "could not extend lease" )
141141 }
142142
143143 return nil
@@ -176,7 +176,7 @@ func (q *taskQueue[T]) Complete(ctx context.Context, taskID string) error {
176176func (q * taskQueue [T ]) Data (ctx context.Context , taskID string ) (* TaskItem [T ], error ) {
177177 msg , err := q .rdb .XRange (ctx , q .streamKey , taskID , taskID ).Result ()
178178 if err != nil && err != redis .Nil {
179- return nil , errors .Wrap (nil , "could not find task" )
179+ return nil , errors .Wrap (err , "could not find task" )
180180 }
181181
182182 return msgToTaskItem [T ](& msg [0 ])
@@ -195,7 +195,7 @@ func (q *taskQueue[T]) recover(ctx context.Context, idleTimeout time.Duration) (
195195 }).Result ()
196196
197197 if err != nil {
198- return nil , errors .Wrap (nil , "could not recover tasks" )
198+ return nil , errors .Wrap (err , "could not recover tasks" )
199199 }
200200
201201 if len (msgs ) == 0 {
0 commit comments