changeset 92 | 05c201b548b0 |
parent 88 | df00ec8423fe |
child 94 | beee0238a82e |
--- a/timelines.go Wed Apr 12 22:46:16 2017 +0200 +++ b/timelines.go Wed Apr 12 23:02:15 2017 +0200 @@ -30,6 +30,13 @@ err = json.Unmarshal([]byte(r.Body), &tl) if err != nil { + var res struct { + Error string `json:"error"` + } + err2 := json.Unmarshal([]byte(r.Body), &res) + if err2 == nil { + return tl, fmt.Errorf("%s", res.Error) + } return tl, fmt.Errorf("timelines API: %s", err.Error()) }