-
-
Notifications
You must be signed in to change notification settings - Fork 320
Open
Labels
feature requestRequest for new feature or functionalityRequest for new feature or functionality
Description
It would be nice to have some predefined errors like:
var (
ErrNoCertAvailable = errors.New("no certificate available")
ErrSomethingWrong = errors.New("...")
// TBD.
)So the client code could do:
if errors.Is(err, certmagic.ErrNoCertAvailable) { // Do something here }So far we have some tricky logic that selects a certificate for the connection, which involves certmagic, static certificates, and some internal tools.
Having the ability to check for particular error would be really helpful.
What would you like to have changed?
Line 404 in d2a7286
| return Certificate{}, fmt.Errorf("no certificate available for '%s'", name) |
Why is this feature a useful, necessary, and/or important addition to this project?
It allows checking for the specific errors via generic methods like errors.Is
What alternatives are there, or what are you doing in the meantime to work around the lack of this feature?
if strings.Contains(err.Error(), "no certificate available") { ... } Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestRequest for new feature or functionalityRequest for new feature or functionality