Improve error output for Cloudflare
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
This commit is contained in:
parent
36a14544e0
commit
02ba02167a
@ -236,7 +236,7 @@ func (c *DNSProvider) makeRequest(method, uri string, body io.Reader) (json.RawM
|
||||
}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error querying Cloudflare API -> %v", err)
|
||||
return nil, fmt.Errorf("Error querying Cloudflare API for %s %q -> %v", method, uri, err)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
@ -256,9 +256,9 @@ func (c *DNSProvider) makeRequest(method, uri string, body io.Reader) (json.RawM
|
||||
errStr += fmt.Sprintf("<- %d: %s", chainErr.Code, chainErr.Message)
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("Cloudflare API Error \n%s", errStr)
|
||||
return nil, fmt.Errorf("Cloudflare API Error for %s %q \n%s", method, uri, errStr)
|
||||
}
|
||||
return nil, fmt.Errorf("Cloudflare API error")
|
||||
return nil, fmt.Errorf("Cloudflare API error for %s %q", method, uri)
|
||||
}
|
||||
|
||||
return r.Result, nil
|
||||
|
||||
Loading…
Reference in New Issue
Block a user