pki/vendor/github.com/go-acme/lego/v4/certificate/errors.go
Paul Lecuq a7d4f06285
All checks were successful
continuous-integration/drone/push Build is passing
ready for public beta
2020-11-25 20:36:07 +01:00

31 lines
588 B
Go

package certificate
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("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
}