cmd: add option to get and set policy directly from database (#2765)

This commit is contained in:
Kristoffer Dalby
2025-09-12 16:55:15 +02:00
committed by GitHub
parent 2938d03878
commit 2b30a15a68
10 changed files with 365 additions and 126 deletions

View File

@@ -169,7 +169,14 @@ func ErrorOutput(errResult error, override string, outputFormat string) {
Error string `json:"error"`
}
fmt.Fprintf(os.Stderr, "%s\n", output(errOutput{errResult.Error()}, override, outputFormat))
var errorMessage string
if errResult != nil {
errorMessage = errResult.Error()
} else {
errorMessage = override
}
fmt.Fprintf(os.Stderr, "%s\n", output(errOutput{errorMessage}, override, outputFormat))
os.Exit(1)
}