mirror of
https://github.com/sstent/go-garminconnect.git
synced 2026-01-25 16:42:32 +00:00
tests passing
This commit is contained in:
@@ -89,7 +89,10 @@ func (c *Client) doRequest(ctx context.Context, method, path string, body io.Rea
|
||||
|
||||
c.logger.Debugf("Response status: %s", resp.Status)
|
||||
|
||||
// Handle non-200 responses
|
||||
// Handle specific status codes
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
return fmt.Errorf("resource not found")
|
||||
}
|
||||
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
||||
return fmt.Errorf("unexpected status code: %d", resp.StatusCode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user