Add warning log for unknown config fields
Add error log for failure to parse toml Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
@@ -91,7 +91,7 @@ var configCommand = cli.Command{
|
||||
Usage: "See the output of the final main config with imported in subconfig files",
|
||||
Action: func(context *cli.Context) error {
|
||||
config := defaultConfig()
|
||||
if err := srvconfig.LoadConfig(context.GlobalString("config"), config); err != nil && !os.IsNotExist(err) {
|
||||
if err := srvconfig.LoadConfig(gocontext.Background(), context.GlobalString("config"), config); err != nil && !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ can be used and modified as necessary as a custom configuration.`
|
||||
configPath := context.GlobalString("config")
|
||||
_, err := os.Stat(configPath)
|
||||
if !os.IsNotExist(err) || context.GlobalIsSet("config") {
|
||||
if err := srvconfig.LoadConfig(configPath, config); err != nil {
|
||||
if err := srvconfig.LoadConfig(ctx, configPath, config); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user