Check for existing types for default error handler registration
@@ -177,9 +177,19 @@ func LoadConfig(body hcl.Body, src []byte, filename string) (*config.Couper, err
}
if acDefault, has := ac.(config.ErrorHandlerGetter); has {
+ defaultHandler := acDefault.DefaultErrorHandler()
+ var exist bool
+ for _, kind := range defaultHandler.Kinds {
+ _, exist = configuredLabels[kind]
+ if exist {
+ break
+ }
+ }
+ if !exist {
ac.Set(acDefault.DefaultErrorHandler())
}
}
+ }
case settings:
if diags = gohcl.DecodeBody(outerBlock.Body, envContext, couperConfig.Settings); diags.HasErrors() {
