mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-04 15:58:13 +08:00
config: nicer error to user
This commit is contained in:
parent
1a5cb300cb
commit
8786602df1
@ -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`.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user