fix: acme errors management.
This commit is contained in:
parent
1e8df9f245
commit
7a1feb3c51
5 changed files with 82 additions and 51 deletions
13
vendor/github.com/xenolf/lego/acmev2/error.go
generated
vendored
13
vendor/github.com/xenolf/lego/acmev2/error.go
generated
vendored
|
@ -1,6 +1,7 @@
|
|||
package acmev2
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
@ -13,6 +14,18 @@ const (
|
|||
invalidNonceError = "urn:ietf:params:acme:error:badNonce"
|
||||
)
|
||||
|
||||
// ObtainError is returned when there are specific errors available
|
||||
// per domain. For example in ObtainCertificate
|
||||
type ObtainError map[string]error
|
||||
|
||||
func (e ObtainError) Error() string {
|
||||
buffer := bytes.NewBufferString("acme: Error -> One or more domains had a problem:\n")
|
||||
for dom, err := range e {
|
||||
buffer.WriteString(fmt.Sprintf("[%s] %s\n", dom, err))
|
||||
}
|
||||
return buffer.String()
|
||||
}
|
||||
|
||||
// RemoteError is the base type for all errors specific to the ACME protocol.
|
||||
type RemoteError struct {
|
||||
StatusCode int `json:"status,omitempty"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue