mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 18:13:54 +08:00
config: nicer error to user
This commit is contained in:
@ -17,7 +17,10 @@ func ReadConfigFile(filename string, cfg interface{}) error {
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
return Decode(f, cfg)
|
||||
if err := Decode(f, cfg); err != nil {
|
||||
return fmt.Errorf("Failure to decode config: %s", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WriteConfigFile writes the config from `cfg` into `filename`.
|
||||
|
Reference in New Issue
Block a user