Skip to content

Commit 709eadf

Browse files
chore(uploader): Add logging for failed request initialization
1 parent 58e3cb8 commit 709eadf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/uploader/uploader.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ func (u *Uploader) send(ctx context.Context, b Batch) {
6464
url := u.cfg.BaseURL + "/runs/multipart"
6565
var attempt int
6666
for {
67-
req, _ := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(b.Data))
67+
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(b.Data))
68+
if err != nil {
69+
slog.Error("Failed to initialize request", "err", err)
70+
return
71+
}
6872
req.Header.Set("Content-Type", "multipart/form-data; boundary="+b.Boundary)
6973
req.Header.Set("Content-Encoding", "zstd")
7074
req.Header.Set("X-API-Key", u.cfg.APIKey)

0 commit comments

Comments
 (0)