X-Git-Url: https://git.octo.it/?p=kraftakt.git;a=blobdiff_plain;f=fitbit%2Ffitbit.go;fp=fitbit%2Ffitbit.go;h=ef6282e0b4120db0ef26a5583bb068c253fc3dab;hp=9466b12f9de0edf8d326705a5a51b8587f3db5d9;hb=c80fecc1379437f3b3c7420f57ce18ae5febf2b3;hpb=1ce3c0a76452d49dc65e4321b6746c5ae3e8982f diff --git a/fitbit/fitbit.go b/fitbit/fitbit.go index 9466b12..ef6282e 100644 --- a/fitbit/fitbit.go +++ b/fitbit/fitbit.go @@ -228,8 +228,7 @@ func (c *Client) Subscribe(ctx context.Context, collection string) error { if res.StatusCode >= 400 && res.StatusCode != http.StatusConflict { data, _ := ioutil.ReadAll(res.Body) - log.Errorf(ctx, "creating %q subscription failed: status %d %q", collection, res.StatusCode, data) - return fmt.Errorf("creating %q subscription failed", collection) + return fmt.Errorf("creating %q subscription failed: status %d %q", collection, res.StatusCode, data) } if res.StatusCode == http.StatusConflict { log.Infof(ctx, "creating %q subscription: already exists", collection) @@ -258,8 +257,7 @@ func (c *Client) unsubscribe(ctx context.Context, userID, collection, subscripti if res.StatusCode >= 400 && res.StatusCode != http.StatusNotFound { data, _ := ioutil.ReadAll(res.Body) - log.Errorf(ctx, "deleting %q subscription failed: status %d %q", collection, res.StatusCode, data) - return fmt.Errorf("deleting %q subscription failed", collection) + return fmt.Errorf("deleting %q subscription failed: status %d %q", collection, res.StatusCode, data) } if res.StatusCode == http.StatusNotFound { log.Infof(ctx, "deleting %q subscription: not found", collection) @@ -377,8 +375,7 @@ func (c *Client) Profile(ctx context.Context) (*Profile, error) { if res.StatusCode >= 400 { data, _ := ioutil.ReadAll(res.Body) - log.Errorf(ctx, "reading profile failed: %s", data) - return nil, fmt.Errorf("HTTP %d error", res.StatusCode) + return nil, fmt.Errorf("reading profile failed: %s", data) } var data struct {