Skip to content

Commit

Permalink
feat(twitter): log response body
Browse files Browse the repository at this point in the history
  • Loading branch information
rgmz committed Feb 2, 2025
1 parent 4cb6a56 commit a407ee1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/detectors/twitterconsumerkey/twitterconsumerkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
b64 "encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"strings"

Expand Down Expand Up @@ -138,7 +139,8 @@ func fetchBearerToken(ctx context.Context, client *http.Client, key, secret stri
}
return token.AccessToken, nil
default:
return "", fmt.Errorf("unexpected HTTP response status %d", res.StatusCode)
body, _ := io.ReadAll(res.Body)
return "", fmt.Errorf("unexpected HTTP response status %d, body = %s", res.StatusCode, string(body))
}
}

Expand Down

0 comments on commit a407ee1

Please sign in to comment.