Add panic recovery to DNSControl provider adapter initialization
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e874d9aa44
commit
49dc9a0dac
1 changed files with 7 additions and 1 deletions
|
|
@ -92,7 +92,13 @@ type DNSControlConfigAdapter interface {
|
|||
ToDNSControlConfig() (map[string]string, error)
|
||||
}
|
||||
|
||||
func NewDNSControlProviderAdapter(configAdapter DNSControlConfigAdapter) (happydns.ProviderActuator, error) {
|
||||
func NewDNSControlProviderAdapter(configAdapter DNSControlConfigAdapter) (ret happydns.ProviderActuator, err error) {
|
||||
defer func() {
|
||||
if a := recover(); a != nil {
|
||||
err = fmt.Errorf("%s", a)
|
||||
}
|
||||
}()
|
||||
|
||||
config, err := configAdapter.ToDNSControlConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue