Skip to content

Commit

Permalink
Add new log message with key length
Browse files Browse the repository at this point in the history
  • Loading branch information
DarcyRaynerDD committed Jun 13, 2019
1 parent c17ea6c commit c74c8d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/metrics/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func (cl *APIClient) SendMetrics(metrics []APIMetric) error {
defer resp.Body.Close()

if resp.StatusCode < 200 || resp.StatusCode > 299 {
if resp.StatusCode == 403 {
logger.Debug(fmt.Sprintf("authorization failed with api key of length %d characters", len(cl.apiKey)))
}
bodyBytes, err := ioutil.ReadAll(resp.Body)
body := ""
if err == nil {
Expand Down

0 comments on commit c74c8d2

Please sign in to comment.