Package fitbit: Don't treat Conflict (409) as an error.
[kraftakt.git] / fitbit / fitbit.go
index 4555e22..bde96ff 100644 (file)
@@ -188,7 +188,7 @@ func (c *Client) Subscribe(ctx context.Context, collection string) error {
        }
        defer res.Body.Close()
 
-       if res.StatusCode >= 400 {
+       if res.StatusCode >= 400 && res.StatusCode != http.StatusConflict {
                data, _ := ioutil.ReadAll(res.Body)
                log.Errorf(ctx, "creating subscription failed: status %d %q", res.StatusCode, data)
                return fmt.Errorf("creating subscription failed")