I'm an idiot

This commit is contained in:
Andre Medeiros 2021-07-13 14:40:56 -04:00
parent 6d0ee9c0c9
commit 2b0078c8f2
2 changed files with 1 additions and 2 deletions

View file

@ -13,7 +13,7 @@ import (
func (a *api) upsertAccountHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
acct := &data.Account{}
if err := json.NewDecoder(r.Body).Decode(a); err != nil {
if err := json.NewDecoder(r.Body).Decode(acct); err != nil {
a.logger.WithFields(logrus.Fields{
"err": err,
}).Info("failed to parse request json")

View file

@ -117,7 +117,6 @@ func (rac *AuthenticatedClient) request(r *Request) ([]byte, error) {
}
if resp.StatusCode != 200 {
rac.statsd.Incr("reddit.api.errors", r.tags, 0.1)
fmt.Println(string(bb)) // TODO remove
// Try to parse a json error. Otherwise we generate a generic one
rerr := &Error{}
if jerr := json.Unmarshal(bb, rerr); jerr != nil {