cmd/cli: log the config error that rejected a custom config

The warning reported err, the resolver-config fetch error, which is nil on
every path that reaches it - so a rejected custom config was logged with no
reason attached. cfgErr holds the validation failure.
This commit is contained in:
Cuong Manh Le
2026-08-14 15:30:19 +07:00
parent 062dcbfb12
commit 0db5ee44be
+4 -1
View File
@@ -903,7 +903,10 @@ func processCDFlags(ctx context.Context, cfg *ctrld.Config) (*controld.ResolverC
return resolverConfig, nil
}
}
mainLog.Load().Warn().Err(err).Msg("Disregarding invalid custom config")
// cfgErr, not err: err is the resolver-config fetch error from above, which is
// nil on every path that reaches here, so logging it said nothing about why the
// custom config was rejected.
mainLog.Load().Warn().Err(cfgErr).Msg("Disregarding invalid custom config")
}
bootstrapIP := func(endpoint string) string {