2019-03-11 15:54:35 +00:00
|
|
|
package certificate // import "github.com/xenolf/lego/certificate"
|
2018-12-06 21:50:17 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"fmt"
|
|
|
|
"sort"
|
|
|
|
)
|
|
|
|
|
|
|
|
// obtainError is returned when there are specific errors available per domain.
|
|
|
|
type obtainError map[string]error
|
|
|
|
|
|
|
|
func (e obtainError) Error() string {
|
|
|
|
buffer := bytes.NewBufferString("acme: Error -> One or more domains had a problem:\n")
|
|
|
|
|
|
|
|
var domains []string
|
|
|
|
for domain := range e {
|
|
|
|
domains = append(domains, domain)
|
|
|
|
}
|
|
|
|
sort.Strings(domains)
|
|
|
|
|
|
|
|
for _, domain := range domains {
|
|
|
|
buffer.WriteString(fmt.Sprintf("[%s] %s\n", domain, e[domain]))
|
|
|
|
}
|
|
|
|
return buffer.String()
|
|
|
|
}
|
|
|
|
|
|
|
|
type domainError struct {
|
|
|
|
Domain string
|
|
|
|
Error error
|
|
|
|
}
|