refactor: ensure all property-handling functions return an error

This will allow upstream functions to handle errors in the most appropriate manner
This commit is contained in:
Jose Diaz-Gonzalez
2019-01-21 17:08:01 -05:00
parent 4db7ebd743
commit 6f1e964c9f
4 changed files with 33 additions and 16 deletions

View File

@@ -23,10 +23,14 @@ func main() {
}
if proxy.IsAppProxyEnabled(appName) {
common.LogVerboseQuiet("Setting %s network property 'bind-all-interfaces' to false")
common.PropertyWrite("network", appName, "bind-all-interfaces", "false")
if err := common.PropertyWrite("network", appName, "bind-all-interfaces", "false"); err != nil {
common.LogWarn(err.Error())
}
} else {
common.LogVerboseQuiet("Setting %s network property 'bind-all-interfaces' to true")
common.PropertyWrite("network", appName, "bind-all-interfaces", "true")
if err := common.PropertyWrite("network", appName, "bind-all-interfaces", "true"); err != nil {
common.LogWarn(err.Error())
}
}
}
}

View File

@@ -11,5 +11,8 @@ func main() {
flag.Parse()
appName := flag.Arg(0)
common.PropertyWrite("network", appName, "bind-all-interfaces", "false")
err := common.PropertyWrite("network", appName, "bind-all-interfaces", "false")
if err != nil {
common.LogWarn(err.Error())
}
}

View File

@@ -11,5 +11,8 @@ func main() {
flag.Parse()
appName := flag.Arg(0)
common.PropertyDestroy("network", appName)
err := common.PropertyDestroy("network", appName)
if err != nil {
common.LogFail(err.Error())
}
}