Tweak output

This commit is contained in:
Neil Alexander 2020-05-22 17:03:07 +01:00
parent d944af2b3d
commit 18c68ce997

View file

@ -60,9 +60,9 @@ func PostJSON(
Message string `json:"message"` Message string `json:"message"`
} }
if msgerr := json.NewDecoder(res.Body).Decode(&errorBody); msgerr == nil { if msgerr := json.NewDecoder(res.Body).Decode(&errorBody); msgerr == nil {
return fmt.Errorf("api: %d from %s: %s", res.StatusCode, apiURL, errorBody.Message) return fmt.Errorf("Internal API: %d from %s: %s", res.StatusCode, apiURL, errorBody.Message)
} }
return fmt.Errorf("api: %d from %s", res.StatusCode, apiURL) return fmt.Errorf("Internal API: %d from %s", res.StatusCode, apiURL)
} }
return json.NewDecoder(res.Body).Decode(response) return json.NewDecoder(res.Body).Decode(response)
} }