Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions internal/castai/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"context"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"math"
"net"
Expand Down Expand Up @@ -139,6 +140,9 @@
if err != nil {
return fmt.Errorf("sending logs: %w", err)
}
if resp == nil {
return errors.New("empty response")
}
if resp.IsError() {
return fmt.Errorf("sending logs: request error status_code=%d body=%s", resp.StatusCode(), resp.Body())
}
Expand All @@ -156,6 +160,9 @@
if err != nil {
return fmt.Errorf("sending metrics: %w", err)
}
if resp == nil {
return errors.New("empty response")
}
if resp.IsError() {
return fmt.Errorf("sending metrics: request error status_code=%d body=%s", resp.StatusCode(), resp.Body())
}
Expand All @@ -173,6 +180,9 @@
if err != nil {
return nil, fmt.Errorf("failed to request cluster-actions: %w", err)
}
if resp == nil {
return errors.New("empty response")

Check failure on line 184 in internal/castai/client.go

View workflow job for this annotation

GitHub Actions / Build

not enough return values

Check failure on line 184 in internal/castai/client.go

View workflow job for this annotation

GitHub Actions / lint

not enough return values

Check failure on line 184 in internal/castai/client.go

View workflow job for this annotation

GitHub Actions / lint

not enough return values

Check failure on line 184 in internal/castai/client.go

View workflow job for this annotation

GitHub Actions / lint

not enough return values

Check failure on line 184 in internal/castai/client.go

View workflow job for this annotation

GitHub Actions / lint

not enough return values
}
if resp.IsError() {
return nil, fmt.Errorf("get cluster-actions: request error host=%s, status_code=%d body=%s", c.rest.BaseURL, resp.StatusCode(), resp.Body())
}
Expand All @@ -187,6 +197,9 @@
if err != nil {
return fmt.Errorf("failed to request cluster-actions ack: %w", err)
}
if resp == nil {
return errors.New("empty response")
}
if resp.IsError() {
return fmt.Errorf("ack cluster-actions: request error status_code=%d body=%s", resp.StatusCode(), resp.Body())
}
Expand Down
Loading