Skip to content

Commit f9d7f62

Browse files
authored
dont overwrite finish task err (#219)
1 parent fd1a57a commit f9d7f62

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/tasks/c1api/manager.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,13 @@ func (c *c1ApiTaskManager) finishTask(ctx context.Context, task *v1.Task, resp p
139139
finishCtx, finishCanc := context.WithTimeout(context.Background(), time.Second*30)
140140
defer finishCanc()
141141

142+
var err2 error
142143
var marshalledResp *anypb.Any
143144
if resp != nil {
144-
marshalledResp, err = anypb.New(resp)
145-
if err != nil {
146-
l.Error("c1_api_task_manager.finishTask(): error while attempting to marshal response", zap.Error(err))
147-
return err
145+
marshalledResp, err2 = anypb.New(resp)
146+
if err2 != nil {
147+
l.Error("c1_api_task_manager.finishTask(): error while attempting to marshal response", zap.Error(err2))
148+
return err2
148149
}
149150
}
150151

0 commit comments

Comments
 (0)