From 3e00d0839acf30f8c36d0a8559e514a10daaf1e5 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 20 Dec 2015 18:14:49 +0100 Subject: Drop handleError --- client.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'client.go') diff --git a/client.go b/client.go index a83ef1c..756e649 100644 --- a/client.go +++ b/client.go @@ -88,18 +88,22 @@ func (c *Client) post(s Signer, v interface{}) error { return err } defer resp.Body.Close() - c.parseHeader(resp) if resp.StatusCode >= http.StatusBadRequest { - return handleError(resp) + var p Problem + err = json.NewDecoder(resp.Body).Decode(&p) + if err != nil { + return err + } + return p } + // DEBUG body, err = ioutil.ReadAll(resp.Body) if err != nil { return err } - // DEBUG log.Println("RESPONSE", string(body)) return json.Unmarshal(body, v) //return json.NewDecoder(resp.Body).Decode(v) -- cgit v1.2.3