mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Show error in logs if passing invalid flags in yaml (#9033)
* Show error in logs if passing invalid flags in yaml The YAML configs pass if an invalid flag is set, this causes frustration because the flag could have been mispelled causing a huge mystery. This will strictly check if the flags are deserialized, if a flag doesn't exist, it will error out as a Fatal error with appropriate reasoning which flag is wrong. * Fix review comments to make some of them non-fatal * Make yaml.TypeError a pointer * Remove UnmarshalStrict from spectests since they use a different YAML package Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
This commit is contained in:
@@ -36,7 +36,7 @@ func main() {
|
||||
log.Fatalf("Failed to read file %s: %v", inFile, err)
|
||||
}
|
||||
data := make(KeyPairs, 0)
|
||||
if err := yaml.Unmarshal(in, &data); err != nil {
|
||||
if err := yaml.UnmarshalStrict(in, &data); err != nil {
|
||||
log.Fatalf("Failed to unmarshal yaml: %v", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user