aboutsummaryrefslogtreecommitdiff
path: root/errors.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-20 18:14:49 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-20 18:14:49 +0100
commit3e00d0839acf30f8c36d0a8559e514a10daaf1e5 (patch)
treece59a1bb4b7675526c4b390454094cdebae15b28 /errors.go
parentdbdb1da1416caf6345cc943900315cee17643ee7 (diff)
Drop handleError
Diffstat (limited to 'errors.go')
-rw-r--r--errors.go23
1 files changed, 1 insertions, 22 deletions
diff --git a/errors.go b/errors.go
index 9be62bf..0aaca3e 100644
--- a/errors.go
+++ b/errors.go
@@ -1,12 +1,6 @@
package acme
-import (
- "encoding/json"
- "errors"
- "io/ioutil"
- "log"
- "net/http"
-)
+import "errors"
var (
errBadCSR = errors.New("The CSR is unacceptable (e.g., due to a short key)")
@@ -33,21 +27,6 @@ var urnErrors = map[string]error{
"urn:acme:error:unknownHost": errUnknownHost,
}
-func handleError(r *http.Response) error {
- log.Println("Status:", r.Status)
- defer r.Body.Close()
- body, err := ioutil.ReadAll(r.Body)
- if err != nil {
- return err
- }
- var p Problem
- err = json.Unmarshal(body, &p)
- if err != nil {
- return err
- }
- return p
-}
-
func (p Problem) Error() string {
if err, ok := urnErrors[p.Type]; ok {
return err.Error() + ": " + p.Detail