1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 02:30:39 +08:00

config: nicer error to user

This commit is contained in:
Juan Batiz-Benet
2014-11-20 04:39:55 -08:00
parent 1a5cb300cb
commit 8786602df1

View File

@ -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`.