Skip to content

Commit

Permalink
Handle error in viper.WriteConfigAs function
Browse files Browse the repository at this point in the history
  • Loading branch information
Prajjawalk committed Aug 20, 2023
1 parent ad9994f commit 91ad43e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion runtime/configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ func SaveConfig(path string) {
}

NewDefaultConfig()
viper.WriteConfigAs(filePath)
err = viper.WriteConfigAs(filePath)
if err != nil {
log.Fatalf("[ERROR] failed to write config to file, error: %s", err.Error())
}

fmt.Printf("save_default_config: saved default config at %v", filePath)
}

0 comments on commit 91ad43e

Please sign in to comment.