Skip to content

Commit

Permalink
Fix: handle bad requests during job creation
Browse files Browse the repository at this point in the history
  • Loading branch information
oxy-nr committed Feb 27, 2024
1 parent 3ea5ae3 commit 2f5b771
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/async_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ func (c *Client) GetJobID(
if err != nil {
return "", fmt.Errorf("error reading resp body: %v", err)
}
resp.Body.Close()
defer resp.Body.Close()

if resp.StatusCode >= 300 {
return "", fmt.Errorf("error creating job: %s", respBody)
}

// Unmarshal into job.
job := &Job{}
Expand Down

0 comments on commit 2f5b771

Please # to comment.