aboutsummaryrefslogtreecommitdiff
path: root/errors.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-05 18:19:00 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-05 18:19:00 +0100
commitbbe2bd0eb1f26d01a1c785db11339c4e1d3b4445 (patch)
treeb0ea6bcdca1e37b28570fd47e8ab3eb170efc516 /errors.go
parent016a0a8c3ec0666cf46d39abed1bcac0936aa846 (diff)
Export errors
Diffstat (limited to 'errors.go')
-rw-r--r--errors.go40
1 files changed, 20 insertions, 20 deletions
diff --git a/errors.go b/errors.go
index be69bc6..bc2d1c8 100644
--- a/errors.go
+++ b/errors.go
@@ -9,28 +9,28 @@ import (
)
var (
- errBadCSR = errors.New("The CSR is unacceptable (e.g., due to a short key)")
- errBadNonce = errors.New("The client sent an unacceptable anti-replay nonce")
- errConnection = errors.New("The server could not connect to the client for DV")
- errDnssec = errors.New("The server could not validate a DNSSEC signed domain")
- errMalformed = errors.New("The request message was malformed")
- errServerInternal = errors.New("The server experienced an internal error")
- errTLS = errors.New("The server experienced a TLS error during DV")
- errUnauthorized = errors.New("The client lacks sufficient authorization")
- errUnknownHost = errors.New("The server could not resolve a domain name")
+ ErrBadCSR = errors.New("The CSR is unacceptable (e.g., due to a short key)")
+ ErrBadNonce = errors.New("The client sent an unacceptable anti-replay nonce")
+ ErrConnection = errors.New("The server could not connect to the client for DV")
+ ErrDnssec = errors.New("The server could not validate a DNSSEC signed domain")
+ ErrMalformed = errors.New("The request message was malformed")
+ ErrServerInternal = errors.New("The server experienced an internal error")
+ ErrTLS = errors.New("The server experienced a TLS error during DV")
+ ErrUnauthorized = errors.New("The client lacks sufficient authorization")
+ ErrUnknownHost = errors.New("The server could not resolve a domain name")
)
// Errors
-var Errors = map[string]error{
- "badCSR": errBadCSR,
- "badNonce": errBadNonce,
- "connection": errConnection,
- "dnssec": errDnssec,
- "malformed": errMalformed,
- "serverInternal": errServerInternal,
- "tls": errTLS,
- "unauthorized": errUnauthorized,
- "unknownHost": errUnknownHost,
+var urnErrors = map[string]error{
+ "badCSR": ErrBadCSR,
+ "badNonce": ErrBadNonce,
+ "connection": ErrConnection,
+ "dnssec": ErrDnssec,
+ "malformed": ErrMalformed,
+ "serverInternal": ErrServerInternal,
+ "tls": ErrTLS,
+ "unauthorized": ErrUnauthorized,
+ "unknownHost": ErrUnknownHost,
}
func handleError(r *http.Response) error {
@@ -44,7 +44,7 @@ func handleError(r *http.Response) error {
if err != nil {
return err
}
- if e, ok := Errors["urn:acme:error"+p.Type]; ok {
+ if e, ok := urnErrors["urn:acme:error"+p.Type]; ok {
return fmt.Errorf("%v: %v", e, p.Detail)
}
return errors.New(p.Detail)