1
0
mirror of https://github.com/go-acme/lego.git synced 2025-11-29 08:56:53 +02:00
Files
lego/challenge/resolver/errors.go
2025-10-30 13:02:35 +01:00

28 lines
524 B
Go

package resolver
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 {
_, _ = fmt.Fprintf(buffer, "[%s] %s\n", domain, e[domain])
}
return buffer.String()
}