From f846e741db51ff8e6a2010ebb532f7dbb0edca7c Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 28 Nov 2015 10:22:29 +0100 Subject: Split errors --- errors.go | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'errors.go') diff --git a/errors.go b/errors.go index ce04bf6..bbfeea3 100644 --- a/errors.go +++ b/errors.go @@ -2,14 +2,27 @@ package acme import "errors" +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") +) + +// Errors var Errors = map[string]error{ - "badCSR": errors.New("The CSR is unacceptable (e.g., due to a short key)"), - "badNonce": errors.New("The client sent an unacceptable anti-replay nonce"), - "connection": errors.New("The server could not connect to the client for DV"), - "dnssec": errors.New("The server could not validate a DNSSEC signed domain"), - "malformed": errors.New("The request message was malformed"), - "serverInternal": errors.New("The server experienced an internal error"), - "tls": errors.New("The server experienced a TLS error during DV"), - "unauthorized": errors.New("The client lacks sufficient authorization"), - "unknownHost": errors.New("The server could not resolve a domain name"), + "badCSR": errBadCSR, + "badNonce": errBadNonce, + "connection": errConnection, + "dnssec": errDnssec, + "malformed": errMalformed, + "serverInternal": errServerInternal, + "tls": errTLS, + "unauthorized": errUnauthorized, + "unknownHost": errUnknownHost, } -- cgit v1.2.3