-
Couldn't load subscription status.
- Fork 1.7k
Description
Is your feature request related to a problem? Please describe.
Our current service.Options interface doesn't support error reporting. This creates a risk of silent failures when invalid configurations are used as options.
package service
type Options interface {
AddOption(h HTTP) HTTP
}
When using AddOption, validation errors cannot be surfaced to the caller. Consumers must use separate validation methods or constructors, creating a disconnected validation flow.
Describe the solution you'd like
Create a new interface AddOptionWithValidation that returns an error:
type AddOptionWithValidation interface {
AddOptionWithValidation(h HTTP) (HTTP, error)
}
Services can check for this interface before falling back to the standard Options interface, enabling proper error handling while maintaining backward compatibility.