mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-07-26 09:58:40 +00:00
wrap config schema errors
This commit is contained in:
@@ -106,12 +106,12 @@ func readConfig(configPath string) (config.Config, error) {
|
||||
|
||||
err = schema.ApplyDefaults(&yamlMap)
|
||||
if err != nil {
|
||||
return config.Config{}, err
|
||||
return config.Config{}, fmt.Errorf("failed to apply defaults: %w", err)
|
||||
}
|
||||
|
||||
err = schema.ValidateConfig(yamlMap)
|
||||
if err != nil {
|
||||
return config.Config{}, err
|
||||
return config.Config{}, fmt.Errorf("failed to validate config: %w", err)
|
||||
}
|
||||
|
||||
validatedConfigBytes, err := json.Marshal(yamlMap)
|
||||
|
||||
Reference in New Issue
Block a user