refactor: bubble up error handling so that standard exit codes can be set at the top-level

LogFail shouldn't be called internally if at all possible.
This commit is contained in:
Jose Diaz-Gonzalez committed 2021-02-28 15:20:46 -05:00
1 parent ccdbaa84f9
commit d09a7506df
26 files changed
+113 -80

No files matched your search

+3 -3
View File
@@ -27,12 +27,12 @@ func main() {
case "config-get":
appName := flag.Arg(0)
key := flag.Arg(1)
config.TriggerConfigGet(appName, key)
err = config.TriggerConfigGet(appName, key)
case "config-get-global":
key := flag.Arg(0)
config.TriggerConfigGetGlobal(key)
err = config.TriggerConfigGetGlobal(key)
default:
common.LogFail(fmt.Sprintf("Invalid plugin trigger call: %s", trigger))
err = fmt.Errorf("Invalid plugin trigger call: %s", trigger)
}
if err != nil {