Skip to content

Commit

Permalink
chore(simple_client): Add explicit ServiceUnavailable error type - fi…
Browse files Browse the repository at this point in the history
…x lint
  • Loading branch information
epociask committed Dec 3, 2024
1 parent 2167732 commit 1338611
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func New(cfg *Config) *SimpleCommitmentClient {
// when integration testing
func (c *SimpleCommitmentClient) Health() error {
url := c.cfg.URL + "/health"
req, err := http.NewRequest(http.MethodGet, url, nil)
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, url, nil)
if err != nil {
return err
}
Expand All @@ -48,6 +48,7 @@ func (c *SimpleCommitmentClient) Health() error {
if err != nil {
return err
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return fmt.Errorf("received bad status code: %d", resp.StatusCode)
Expand Down

0 comments on commit 1338611

Please sign in to comment.