Skip to content

Commit

Permalink
Minor tweaks to log and error message
Browse files Browse the repository at this point in the history
A little easier to read in practice
  • Loading branch information
mholt committed Aug 26, 2021
1 parent 6519778 commit 5c1e8a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions acme/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ func (c *Client) httpPostJWS(ctx context.Context, privateKey crypto.Signer,
break
}

return resp, fmt.Errorf("request to %s failed after %d attempts: %w",
endpoint, attempts, err)
return resp, fmt.Errorf("attempt %d: %s: %w", attempts, endpoint, err)
}

// httpReq robustly performs an HTTP request using the given method to the given endpoint, honoring
Expand Down Expand Up @@ -272,8 +271,8 @@ func (c *Client) doHTTPRequest(req *http.Request, buf *bytes.Buffer) (resp *http
zap.String("method", req.Method),
zap.String("url", req.URL.String()),
zap.Reflect("headers", req.Header),
zap.Int("status_code", resp.StatusCode),
zap.Reflect("response_headers", resp.Header))
zap.Reflect("response_headers", resp.Header),
zap.Int("status_code", resp.StatusCode))
}

// "The server MUST include a Replay-Nonce header field
Expand Down

0 comments on commit 5c1e8a9

Please sign in to comment.