projects
/
kraftakt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbefec2
)
Package fitbit: Handle errors from ioutil.ReadAll() and fix warning message.
author
Florian Forster
<ff@octo.it>
Wed, 31 Jan 2018 14:55:40 +0000
(15:55 +0100)
committer
Florian Forster
<ff@octo.it>
Wed, 31 Jan 2018 14:55:40 +0000
(15:55 +0100)
fitbit/fitbit.go
patch
|
blob
|
history
diff --git
a/fitbit/fitbit.go
b/fitbit/fitbit.go
index
8a07fb7
..
7e38bf1
100644
(file)
--- a/
fitbit/fitbit.go
+++ b/
fitbit/fitbit.go
@@
-170,7
+170,10
@@
func (c *Client) ActivitySummary(ctx context.Context, date string) (*ActivitySum
}
defer res.Body.Close()
- data, _ := ioutil.ReadAll(res.Body)
+ data, err := ioutil.ReadAll(res.Body)
+ if err != nil {
+ return nil, err
+ }
log.Debugf(ctx, "GET %s -> %s", url, data)
var summary ActivitySummary
@@
-316,7
+319,7
@@
func (c *Client) ListSubscriptions(ctx context.Context, collection string) ([]Su
}
for _, err := range errs {
- log.Warningf(ctx, err)
+ log.Warningf(ctx,
"%v",
err)
}
return ret, nil