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-21 14:50:43 +07:00
parent 084c785ed5
commit 8ce3b7ca6c
+4 -1
View File
@@ -855,7 +855,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 {