mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/puppeth: add error for config flush
This commit is contained in:
parent
19fa9064d7
commit
0959d26d69
1 changed files with 4 additions and 1 deletions
|
|
@ -63,7 +63,10 @@ func (c config) servers() []string {
|
||||||
func (c config) flush() {
|
func (c config) flush() {
|
||||||
os.MkdirAll(filepath.Dir(c.path), 0755)
|
os.MkdirAll(filepath.Dir(c.path), 0755)
|
||||||
|
|
||||||
out, _ := json.MarshalIndent(c, "", " ")
|
out, err := json.MarshalIndent(c, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
log.Crit("Failed to read puppeth configs", "err", err)
|
||||||
|
}
|
||||||
if err := ioutil.WriteFile(c.path, out, 0644); err != nil {
|
if err := ioutil.WriteFile(c.path, out, 0644); err != nil {
|
||||||
log.Warn("Failed to save puppeth configs", "file", c.path, "err", err)
|
log.Warn("Failed to save puppeth configs", "file", c.path, "err", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue