diff --git a/cmd/common.go b/cmd/common.go index 1e354498b5249e5a5fb55318037deb2b51bb749a..33ded8970c49cd20aecfc78f9cd61eb553772bf5 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -112,6 +112,8 @@ func runChecks(t check.NodeType) { if jsonFmt { out, err := controls.JSON() if err != nil { + fmt.Fprintf(os.Stderr, "failed to output in JSON format: %v\n", err) + os.Exit(1) } fmt.Println(string(out))