chore: wrap errors. (#1070)

This commit is contained in:
Ludovic Fernandez 2020-02-27 19:14:46 +01:00 committed by GitHub
parent 9d31db300b
commit 2da1ce06ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
114 changed files with 584 additions and 565 deletions

View file

@ -118,7 +118,7 @@ func (a *Core) retrievablePost(uri string, content []byte, response interface{})
func (a *Core) signedPost(uri string, content []byte, response interface{}) (*http.Response, error) {
signedContent, err := a.jws.SignContent(uri, content)
if err != nil {
return nil, fmt.Errorf("failed to post JWS message -> failed to sign content -> %v", err)
return nil, fmt.Errorf("failed to post JWS message -> failed to sign content -> %w", err)
}
signedBody := bytes.NewBuffer([]byte(signedContent.FullSerialize()))
@ -155,7 +155,7 @@ func (a *Core) GetDirectory() acme.Directory {
func getDirectory(do *sender.Doer, caDirURL string) (acme.Directory, error) {
var dir acme.Directory
if _, err := do.Get(caDirURL, &dir); err != nil {
return dir, fmt.Errorf("get directory at '%s': %v", caDirURL, err)
return dir, fmt.Errorf("get directory at '%s': %w", caDirURL, err)
}
if dir.NewAccountURL == "" {