From c2e3b81830ec6fdd1a448912ff23d36024b17ec6 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Tue, 13 Jul 2021 14:22:41 -0400 Subject: [PATCH] Add some debugging --- internal/cmd/api.go | 2 +- internal/reddit/client.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/cmd/api.go b/internal/cmd/api.go index 42761ec..a7b4d47 100644 --- a/internal/cmd/api.go +++ b/internal/cmd/api.go @@ -19,7 +19,7 @@ func APICmd(ctx context.Context) *cobra.Command { Args: cobra.ExactArgs(0), Short: "Runs the RESTful API.", RunE: func(cmd *cobra.Command, args []string) error { - port = 400 + port = 4000 if os.Getenv("PORT") != "" { port, _ = strconv.Atoi(os.Getenv("PORT")) } diff --git a/internal/reddit/client.go b/internal/reddit/client.go index c9d7b4f..52dfe9c 100644 --- a/internal/reddit/client.go +++ b/internal/reddit/client.go @@ -115,10 +115,9 @@ func (rac *AuthenticatedClient) request(r *Request) ([]byte, error) { rac.statsd.Incr("reddit.api.errors", r.tags, 0.1) return nil, err } - if resp.StatusCode != 200 { rac.statsd.Incr("reddit.api.errors", r.tags, 0.1) - + fmt.Println(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 {