Skip to content

Commit

Permalink
fix(worker): throw error for empty container response (#88)
Browse files Browse the repository at this point in the history
This commit ensures that an error is returned to the gateway when the
runner container returns a successful but empty response.
  • Loading branch information
rickstaa authored May 17, 2024
1 parent 6bad18e commit c05cccf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ func (w *Worker) ImageToVideo(ctx context.Context, req ImageToVideoMultipartRequ
return nil, errors.New("image-to-video container returned 500")
}

if resp.JSON200 == nil {
slog.Error("image-to-video container returned no content")
return nil, errors.New("image-to-video container returned no content")
}

return resp.JSON200, nil
}

Expand Down

0 comments on commit c05cccf

Please sign in to comment.