Skip to content

Commit

Permalink
add body on err unmarshal
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Roy Almerol committed Oct 30, 2024
1 parent 6e06bd9 commit 49bb69d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/jobs/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ func GetMostRecentTask(job *store.Job, r *http.Request) (*Task, error) {
return nil, err
}

tasks := make([]Task, 0)
var tasks []Task
err = json.Unmarshal(tasksBody, &tasks)
if err != nil {
fmt.Println(tasksBody)
return nil, err
}

Expand Down Expand Up @@ -95,6 +96,7 @@ func GetTaskByUPID(upid string, r *http.Request) (*Task, error) {
var task Task
err = json.Unmarshal(tasksBody, &task)
if err != nil {
fmt.Println(tasksBody)
return nil, err
}

Expand Down

0 comments on commit 49bb69d

Please sign in to comment.