@@ -137,7 +137,7 @@ func (q *taskQueue[T]) Extend(ctx context.Context, taskID string) error {
137
137
MinIdle : 0 , // Always claim this message
138
138
}).Result ()
139
139
if err != nil && err != redis .Nil {
140
- return errors .Wrap (nil , "could not extend lease" )
140
+ return errors .Wrap (err , "could not extend lease" )
141
141
}
142
142
143
143
return nil
@@ -176,7 +176,7 @@ func (q *taskQueue[T]) Complete(ctx context.Context, taskID string) error {
176
176
func (q * taskQueue [T ]) Data (ctx context.Context , taskID string ) (* TaskItem [T ], error ) {
177
177
msg , err := q .rdb .XRange (ctx , q .streamKey , taskID , taskID ).Result ()
178
178
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" )
180
180
}
181
181
182
182
return msgToTaskItem [T ](& msg [0 ])
@@ -195,7 +195,7 @@ func (q *taskQueue[T]) recover(ctx context.Context, idleTimeout time.Duration) (
195
195
}).Result ()
196
196
197
197
if err != nil {
198
- return nil , errors .Wrap (nil , "could not recover tasks" )
198
+ return nil , errors .Wrap (err , "could not recover tasks" )
199
199
}
200
200
201
201
if len (msgs ) == 0 {
0 commit comments